Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
STUPID ME. Don't die awfully when pals shutdown there sockets properly. Shame, shame
[simgrid.git] / src / gras / Transport / transport_plugin_tcp.c
index a4db1b6..d1c3ef0 100644 (file)
@@ -334,8 +334,11 @@ gras_trp_tcp_recv_withbuffer(gras_socket_t sock,
       bufsize -= status;
       got     += status;
     } else {
-      THROW1(system_error,0,"Socket closed by remote side (got %d bytes before this)",
-            got);
+      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. */
     }
   }
   return got;