Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check PROPERLY whether there is more data to consume from the buffer (to avoid a...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 27 Aug 2006 22:05:10 +0000 (22:05 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 27 Aug 2006 22:05:10 +0000 (22:05 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2754 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Transport/transport_plugin_tcp.c

index bf76ad7..fef04c1 100644 (file)
@@ -338,8 +338,7 @@ gras_trp_tcp_recv_withbuffer(gras_socket_t sock,
             got);
     }
   }
             got);
     }
   }
-  /* indicate to the gras_select function that there is more to read on this socket so that it does not actually select */
-  sock->moredata = (bufsize != 0);
+
   return got;
 }
 
   return got;
 }
 
@@ -475,7 +474,10 @@ gras_trp_buf_recv(gras_socket_t sock,
     DEBUG4("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
           data->in_buf.pos,size - chunk_pos,size,hexa_str((unsigned char*)chunk,chunk_pos,0));
   }
     DEBUG4("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
           data->in_buf.pos,size - chunk_pos,size,hexa_str((unsigned char*)chunk,chunk_pos,0));
   }
-
+  /* indicate on need to the gras_select function that there is more to read on this socket so that it does not actually select */
+  sock->moredata = (data->in_buf.size > data->in_buf.pos);
+  DEBUG1("There is %smore data",(sock->moredata?"":"no "));
+   
   XBT_OUT;
   return chunk_pos;
 }
   XBT_OUT;
   return chunk_pos;
 }