From: Ben Laurie Date: Fri, 23 Jul 1999 18:14:44 +0000 (+0000) Subject: Actually, we should always close the connection when it is finished. X-Git-Tag: 1.3.7~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9297cae25d83e8dcf6a5b0149af5d6c60587121;p=thirdparty%2Fapache%2Fhttpd.git Actually, we should always close the connection when it is finished. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83488 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/connection.c b/server/connection.c index 3c81e12eb05..c4cff197125 100644 --- a/server/connection.c +++ b/server/connection.c @@ -197,6 +197,28 @@ CORE_EXPORT(void) ap_process_connection(conn_rec *c) ap_run_pre_connection(c); ap_run_process_connection(c); + + /* + * Close the connection, being careful to send out whatever is still + * in our buffers. If possible, try to avoid a hard close until the + * client has ACKed our FIN and/or has stopped sending us data. + */ + +#ifdef NO_LINGCLOSE + ap_bclose(c->client); /* just close it */ +#else + if (r && r->connection + && !r->connection->aborted + && r->connection->client + && (r->connection->client->fd >= 0)) { + + lingering_close(r); + } + else { + ap_bsetflag(c->client, B_EOUT, 1); + ap_bclose(c->client); + } +#endif } int ap_process_http_connection(conn_rec *c) @@ -227,28 +249,6 @@ int ap_process_http_connection(conn_rec *c) } } - /* - * Close the connection, being careful to send out whatever is still - * in our buffers. If possible, try to avoid a hard close until the - * client has ACKed our FIN and/or has stopped sending us data. - */ - -#ifdef NO_LINGCLOSE - ap_bclose(c->client); /* just close it */ -#else - if (r && r->connection - && !r->connection->aborted - && r->connection->client - && (r->connection->client->fd >= 0)) { - - lingering_close(r); - } - else { - ap_bsetflag(c->client, B_EOUT, 1); - ap_bclose(c->client); - } -#endif - return OK; }