httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r390608 - in /httpd/httpd/branches/2.2.x: CHANGES modules/proxy/mod_proxy_http.c
Date Sat, 01 Apr 2006 06:54:11 GMT
Author: pquerna
Date: Fri Mar 31 22:54:11 2006
New Revision: 390608

URL: http://svn.apache.org/viewcvs?rev=390608&view=rev
Log:
Merge r377053, r377057 and r377525 from trunk, fixing several issues with mod_disk_cache and
keep-alive headers.

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/CHANGES?rev=390608&r1=390607&r2=390608&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Fri Mar 31 22:54:11 2006
@@ -14,6 +14,9 @@
      made to ap_escape_html so we escape quotes.  Reported by JPCERT.
      [Mark Cox]
 
+  *) mod_proxy_http: Send HTTP Keep-Alive Headers. PR 38524.
+     [Rüdiger Plüm, Joe Orton]
+
   *) mod_disk_cache: Return the correct error codes from bucket read 
      failures, instead of APR_EGENERAL.
      [Brian Akins <brian.akins turner.com>]

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c?rev=390608&r1=390607&r2=390608&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c Fri Mar 31 22:54:11 2006
@@ -595,6 +595,7 @@
     apr_off_t bytes_read = 0;
     apr_off_t bytes;
     int force10;
+    apr_table_t *headers_in_copy;
 
     header_brigade = apr_brigade_create(p, origin->bucket_alloc);
 
@@ -602,23 +603,6 @@
      * Send the HTTP/1.1 request to the remote server
      */
 
-    /* strip connection listed hop-by-hop headers from the request */
-    /* even though in theory a connection: close coming from the client
-     * should not affect the connection to the server, it's unlikely
-     * that subsequent client requests will hit this thread/process,
-     * so we cancel server keepalive if the client does.
-     */
-    if (ap_proxy_liststr(apr_table_get(r->headers_in,
-                         "Connection"), "close")) {
-        p_conn->close++;
-        /* XXX: we are abusing r->headers_in rather than a copy,
-         * give the core output handler a clue the client would
-         * rather just close.
-         */
-        c->keepalive = AP_CONN_CLOSE;
-    }
-    ap_proxy_clear_connection(p, r->headers_in);
-
     if (apr_table_get(r->subprocess_env, "force-proxy-request-1.0")) {
         buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.0" CRLF, NULL);
         force10 = 1;
@@ -736,9 +720,22 @@
                          r->server->server_hostname);
     }
 
-    /* send request headers */
     proxy_run_fixups(r);
-    headers_in_array = apr_table_elts(r->headers_in);
+    /*
+     * Make a copy of the headers_in table before clearing the connection
+     * headers as we need the connection headers later in the http output
+     * filter to prepare the correct response headers.
+     *
+     * Note: We need to take r->pool for apr_table_copy as the key / value
+     * pairs in r->headers_in have been created out of r->pool and
+     * p might be (and actually is) a longer living pool.
+     * This would trigger the bad pool ancestry abort in apr_table_copy if
+     * apr is compiled with APR_POOL_DEBUG.
+     */
+    headers_in_copy = apr_table_copy(r->pool, r->headers_in);
+    ap_proxy_clear_connection(p, headers_in_copy);
+    /* send request headers */
+    headers_in_array = apr_table_elts(headers_in_copy);
     headers_in = (const apr_table_entry_t *) headers_in_array->elts;
     for (counter = 0; counter < headers_in_array->nelts; counter++) {
         if (headers_in[counter].key == NULL



Mime
View raw message