]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport proxy_util fix to select worker (jim)
authorNick Kew <niq@apache.org>
Fri, 13 Jan 2006 13:23:17 +0000 (13:23 +0000)
committerNick Kew <niq@apache.org>
Fri, 13 Jan 2006 13:23:17 +0000 (13:23 +0000)
http://svn.apache.org/viewcvs.cgi/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=356030&view=diff&r1=356030&r2=332306

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@368708 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/proxy_util.c

diff --git a/STATUS b/STATUS
index e8eae5837bcc2eca6cd9fe45e9b6799f898d6858..7aaa7c166ad362cee09d2547052667a59dbdba69 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -99,11 +99,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
       Message-ID: <4395A056.2070000@web.turner.com>
       +1: jerenkrantz, jim, wrowe
 
-    * proxy_util: Fix case where a shared keepalive connection results in
-      different (and incorrect) workers from being accessed.
-      http://svn.apache.org/viewcvs.cgi/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=356030&view=diff&r1=356030&r2=332306
-      +1: jim, rpluem, mturk
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 
index 96a743eadc01f20d791222681dabd0f28bdeac26..410f501711cea7b4795053974ebf101d5da409d8 100644 (file)
@@ -1824,16 +1824,19 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
                            uri->fragment ? "#" : "",
                            uri->fragment ? uri->fragment : "", NULL);
     }
-    if (!worker->is_address_reusable) {
-        if (proxyname) {
-            conn->hostname = proxyname;
-            conn->port = proxyport;
-        } else {
-            conn->hostname = uri->hostname;
-            conn->port = uri->port;
-        }
-    }
-    else if (!conn->hostname) {
+    /*
+     * Make sure that we pick the the correct and valid worker.
+     * If a single keepalive connection triggers different workers,
+     * then we have a problem (we don't select the correct one).
+     * Do an expensive check in this case, where we compare the
+     * the hostnames associated between the two.
+     *
+     * TODO: Handle this much better...
+     */
+    if (!conn->hostname || !worker->is_address_reusable ||   
+         (r->connection->keepalives &&
+         (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE) &&
+         (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) {
         if (proxyname) {
             conn->hostname = apr_pstrdup(conn->pool, proxyname);
             conn->port = proxyport;