From: danw Date: Thu, 20 Aug 1998 14:45:26 +0000 (+0000) Subject: fix a bug in mr_cont_accept that would cause problems when a client X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/88381def257796745f94dd6752aacb21811b98ac fix a bug in mr_cont_accept that would cause problems when a client closed its connection immediately after connecting but before sending any data. --- diff --git a/lib/mr_connect.c b/lib/mr_connect.c index b47280cb..11e17776 100644 --- a/lib/mr_connect.c +++ b/lib/mr_connect.c @@ -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;