From: Bill Stoddard Date: Sat, 2 Jun 2001 20:34:03 +0000 (+0000) Subject: Fix problem with lingering_close() on Windows. Issuing read() on the X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d719270bd35ec262765356467552bf5e62a3e95;p=thirdparty%2Fapache%2Fhttpd.git Fix problem with lingering_close() on Windows. Issuing read() on the socket descriptor on Windows always fails. Should be calling recv() instead of read() on Windows. Thanks to Bill Rowe (and bounds checker :-) for pointing this out. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@89259 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index 5cbee4c2dd0..41c910a4cdd 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,4 +1,8 @@ Changes with Apache 1.3.21 + *) Fix problem with lingering_close() on Windows. Issuing read() on the + socket descriptor on Windows always fails. Should be calling + recv() instead of read() on Windows. + [Bill Stoddard, Bill Rowe] *) Added an abnormal exit clean up routine to make sure that ApacheC NLM is always unloaded cleanly. This fixes the "Ouch! out of memory" diff --git a/src/main/http_main.c b/src/main/http_main.c index f79c9a8f385..260fb2e426c 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -1565,7 +1565,11 @@ static void lingering_close(request_rec *r) select_rv = ap_select(lsd + 1, &lfds, NULL, NULL, &tv); } while ((select_rv > 0) && +#ifdef WIN32 + (recv(lsd, dummybuf, sizeof dummybuf, 0) > 0)); +#else (read(lsd, dummybuf, sizeof dummybuf) > 0)); +#endif /* Should now have seen final ack. Safe to finally kill socket */