diff libfdcore/sctp.c @ 1102:1d7b3ebda27f

Implemented the calls to HOOK_DATA_RECEIVED hook
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 09 May 2013 16:40:02 +0800
parents 74bba7975864
children 96f2051215c8
line wrap: on
line diff
--- a/libfdcore/sctp.c	Thu May 09 12:06:03 2013 +0800
+++ b/libfdcore/sctp.c	Thu May 09 16:40:02 2013 +0800
@@ -1085,7 +1085,7 @@
 	
 	/* We will loop while all data is not received. */
 incomplete:
-	while (datasize + sizeof(struct timespec) >= bufsz ) {
+	while (datasize >= bufsz ) {
 		/* The buffer is full, enlarge it */
 		bufsz += mempagesz;
 		CHECK_MALLOC( data = realloc(data, bufsz ) );
@@ -1093,7 +1093,7 @@
 	/* the new data will be received following the preceding */
 	memset(&iov,  0, sizeof(iov));
 	iov.iov_base = data + datasize ;
-	iov.iov_len  = bufsz - sizeof(struct timespec) - datasize;
+	iov.iov_len  = bufsz - datasize;
 
 	/* Receive data from the socket */
 again:
"Welcome to our mercurial repository"