From: Jim Jagielski Date: Tue, 20 Nov 2007 14:04:47 +0000 (+0000) Subject: Merge r594839 from trunk: X-Git-Tag: 2.2.7~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b3716cc16931127e7cd325ce6ef878cb2f12dbf;p=thirdparty%2Fapache%2Fhttpd.git Merge r594839 from trunk: core: Avoid some unexpected connection closes by telling the client that the connection is not persistent if the MPM process handling the request is already exiting when the response header is built. Submitted by: trawick Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@596677 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e326de046ca..f288923fed0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.7 + *) core: Avoid some unexpected connection closes by telling the client + that the connection is not persistent if the MPM process handling + the request is already exiting when the response header is built. + [Jeff Trawick] + *) mod_autoindex: Generate valid XHTML output by adding the xhtml namespace. PR 43649 [Jose Kahan ] diff --git a/STATUS b/STATUS index 903b2c1330f..3211663902c 100644 --- a/STATUS +++ b/STATUS @@ -109,13 +109,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: niq says: done jim: +1 - * core: Avoid some unexpected connection closes by telling the client - that the connection is not persistent if the MPM process handling - the request is already exiting when the response header is built. - trunk: http://svn.apache.org/viewvc?view=rev&revision=594839 - 2.2.x: trunk patch applies - +1: trawick, rpluem, jim - * mod_charset_lite cleanups to remove long-abandoned logic and fix some minor style problems trunk: diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index d8886af19bb..3d123c9e733 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -48,6 +48,7 @@ #include "util_charset.h" #include "util_ebcdic.h" #include "util_time.h" +#include "ap_mpm.h" #include "mod_core.h" @@ -187,6 +188,7 @@ AP_DECLARE(int) ap_set_keepalive(request_rec *r) * or they're a buggy twit coming through a HTTP/1.1 proxy * and the client is requesting an HTTP/1.0-style keep-alive * or the client claims to be HTTP/1.1 compliant (perhaps a proxy); + * and this MPM process is not already exiting * THEN we can be persistent, which requires more headers be output. * * Note that the condition evaluation order is extremely important. @@ -212,7 +214,8 @@ AP_DECLARE(int) ap_set_keepalive(request_rec *r) && (!apr_table_get(r->subprocess_env, "nokeepalive") || apr_table_get(r->headers_in, "Via")) && ((ka_sent = ap_find_token(r->pool, conn, "keep-alive")) - || (r->proto_num >= HTTP_VERSION(1,1)))) { + || (r->proto_num >= HTTP_VERSION(1,1))) + && !ap_graceful_stop_signalled()) { int left = r->server->keep_alive_max - r->connection->keepalives; r->connection->keepalive = AP_CONN_KEEPALIVE;