From: mquinson Date: Tue, 27 Jun 2006 21:20:11 +0000 (+0000) Subject: The fact that peer closed the socket should be detected right after the select()... X-Git-Tag: v3.3~2903 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e1a2b99c9a458df65df7d91e6290a474694ac6bd The fact that peer closed the socket should be detected right after the select(). If we see it here, there was a problem. So, raise the exception in any case to allow messaging layer to react sainly to it (right now, the receiver would go into an infinite loop when the sender dies between the header send and the body send) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2455 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Transport/transport_plugin_tcp.c b/src/gras/Transport/transport_plugin_tcp.c index d1c3ef0ffe..a4db1b640a 100644 --- a/src/gras/Transport/transport_plugin_tcp.c +++ b/src/gras/Transport/transport_plugin_tcp.c @@ -334,11 +334,8 @@ gras_trp_tcp_recv_withbuffer(gras_socket_t sock, bufsize -= status; got += status; } else { - if (got) - THROW1(system_error,0,"Socket closed by remote side (got %d bytes before this)", - got); - else - return 0; /* Ok, my pal left. I can handle it. */ + THROW1(system_error,0,"Socket closed by remote side (got %d bytes before this)", + got); } } return got;