From: Bill Stoddard Date: Tue, 31 Jul 2001 00:34:27 +0000 (+0000) Subject: The read() in apr_recv() would always be called first and return EAGAIN. X-Git-Tag: 2.0.23~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22dbf976702af5487d14153f30becd2055140f76;p=thirdparty%2Fapache%2Fhttpd.git The read() in apr_recv() would always be called first and return EAGAIN. This one change to eliminate the read unless there are really bytes to read is good for a 7 to 9% performance boost on AIX. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89809 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/connection.c b/server/connection.c index 70f9fc29ba7..5356c7bd474 100644 --- a/server/connection.c +++ b/server/connection.c @@ -195,6 +195,7 @@ void ap_lingering_close(conn_rec *c) */ timeout = SECONDS_TO_LINGER * APR_USEC_PER_SEC; apr_setsocketopt(c->client_socket, APR_SO_TIMEOUT, timeout); + apr_setsocketopt(c->client_socket, APR_INCOMPLETE_READ, 1); for (;;) { nbytes = sizeof(dummybuf); rc = apr_recv(c->client_socket, dummybuf, &nbytes);