Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 95109 invoked from network); 29 Nov 2005 15:05:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Nov 2005 15:05:42 -0000 Received: (qmail 31507 invoked by uid 500); 29 Nov 2005 15:05:41 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 31469 invoked by uid 500); 29 Nov 2005 15:05:40 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 31458 invoked by uid 99); 29 Nov 2005 15:05:40 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 29 Nov 2005 07:05:40 -0800 Received: (qmail 94824 invoked by uid 65534); 29 Nov 2005 15:05:20 -0000 Message-ID: <20051129150520.94823.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r349723 - /httpd/httpd/trunk/modules/proxy/proxy_util.c Date: Tue, 29 Nov 2005 15:05:19 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jim Date: Tue Nov 29 07:05:16 2005 New Revision: 349723 URL: http://svn.apache.org/viewcvs?rev=349723&view=rev Log: Fix case where a shared keepalive connection results in different workers from being accessed. Try to be wise and fast about the tests before we do the expensive string comparison. Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=349723&r1=349722&r2=349723&view=diff ============================================================================== --- httpd/httpd/trunk/modules/proxy/proxy_util.c (original) +++ httpd/httpd/trunk/modules/proxy/proxy_util.c Tue Nov 29 07:05:16 2005 @@ -1824,12 +1824,22 @@ uri->fragment ? "#" : "", uri->fragment ? uri->fragment : "", NULL); } - if (!worker->is_address_reusable) { + /* + * 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. + * + * TODO: Handle this much better... + */ + if (!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 = proxyname; + conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; } else { - conn->hostname = uri->hostname; + conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } }