From: mquinson Date: Thu, 23 Jun 2005 14:35:10 +0000 (+0000) Subject: Bugfixes: in SG, don't nhol the size, when zeroing out.size, put it to 4 as it ought... X-Git-Tag: v3.3~3978 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2479b96521c45f40637d8e4482c301b677266443?hp=24738931e11d38749f48fb869338c5c6fcd9a8f5 Bugfixes: in SG, don't nhol the size, when zeroing out.size, put it to 4 as it ought to be (how damn could it work before?) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1377 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Transport/transport_plugin_buf.c b/src/gras/Transport/transport_plugin_buf.c index 1de00c6aa0..d640ab7562 100644 --- a/src/gras/Transport/transport_plugin_buf.c +++ b/src/gras/Transport/transport_plugin_buf.c @@ -166,7 +166,8 @@ void gras_trp_buf_socket_close(gras_socket_t sock){ XBT_IN; if (data->in.size!=data->in.pos) { - WARN1("Socket closed, but %d bytes were unread",data->in.size - data->in.pos); + WARN3("Socket closed, but %d bytes were unread (size=%d,pos=%d)", + data->in.size - data->in.pos,data->in.size, data->in.pos); } if (data->out.size!=data->out.pos) { @@ -266,10 +267,10 @@ gras_trp_buf_chunk_recv(gras_socket_t sock, data->in.pos=0; } else { memcpy((char*)&nextsize,data->in.data,4); - data->in.size = (int)ntohl(nextsize)+4; + data->in.size = nextsize+4; data->in.pos=4; - VERB3("Got the chunk (size=%d+4 for the size ifself)='%.*s'",data->in.size-4, - data->in.size,data->in.data); + VERB3("Got the chunk (size=%d+4 for the size ifself)='%.*s'", + data->in.size-4, data->in.size,data->in.data); if (XBT_LOG_ISENABLED(trp_buf,xbt_log_priority_debug)) hexa_print("chunck received",data->in.data,data->in.size); } @@ -307,7 +308,7 @@ gras_trp_buf_flush(gras_socket_t sock) { XBT_IN; DEBUG0("Flush"); if (XBT_LOG_ISENABLED(trp_buf,xbt_log_priority_debug)) - hexa_print("chunck to send",data->out.data,data->out.size); + hexa_print("chunck to send ",data->out.data,data->out.size); if ((data->out.size - data->out.pos) == (gras_if_RL()?0:4) ) { /* 4 first bytes=size in SG mode*/ DEBUG2("Nothing to flush (size=%d; pos=%d)",data->out.size,data->out.pos); return no_error; @@ -329,7 +330,7 @@ gras_trp_buf_flush(gras_socket_t sock) { TRY(super->chunk_send(sock, data->out.data, data->out.size)); VERB1("Chunk sent (size=%d)",data->out.size); if (XBT_LOG_ISENABLED(trp_buf,xbt_log_priority_debug)) - hexa_print("chunck sent",data->out.data,data->out.size); - data->out.size = 0; + hexa_print("chunck sent ",data->out.data,data->out.size); + data->out.size = gras_if_RL()?0:4; return no_error; }