]> andersk Git - moira.git/commitdiff
fix a bug in mr_cont_accept that would cause problems when a client
authordanw <danw>
Thu, 20 Aug 1998 14:45:26 +0000 (14:45 +0000)
committerdanw <danw>
Thu, 20 Aug 1998 14:45:26 +0000 (14:45 +0000)
closed its connection immediately after connecting but before sending
any data.

lib/mr_connect.c

index b47280cbe3c8769836e241e8f2e36f85b0b4dcfc..11e17776b035ab77e8e48427c40fb7c17cf7511f 100644 (file)
@@ -284,6 +284,9 @@ int mr_accept(int s, struct sockaddr_in *sin)
   return status;
 }
 
+/* mr_cont_accept returns 0 if it has failed, an fd if it has succeeded,
+   or -1 if it is still making progress */
+
 int mr_cont_accept(int conn, char **buf, int *nread)
 {
   long len, more;
@@ -294,7 +297,7 @@ int mr_cont_accept(int conn, char **buf, int *nread)
       if (read(conn, lbuf, 4) != 4)
        {
          close(conn);
-         return -1;
+         return 0;
        }
       getlong(lbuf, len);
       len += 4;
This page took 0.038472 seconds and 5 git commands to generate.