From: Jim Jagielski Date: Thu, 1 Dec 2005 13:50:11 +0000 (+0000) Subject: Until we determine whether we should dip into the connection X-Git-Tag: 2.3.0~2704 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48f938e0d6a64fcfd8bbd0a31b2c5e0c1b1f6df9;p=thirdparty%2Fapache%2Fhttpd.git Until we determine whether we should dip into the connection pool each time, rearrange the logic to avoid a double check which is unneeded. No matter what (if it's reusable or not) a null conn->hostname needs to be set. At that point it doesn't matter if we're not reusing it or if the string comparison happens, since what we would do in that case has already been done. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@350250 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index dd7e0b83c38..4877e909b83 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1831,11 +1831,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, * * TODO: Handle this much better... */ - if (!worker->is_address_reusable || - (r->connection->keepalives && - (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE) && - (conn->hostname != NULL) && - (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) { + if (!conn->hostname) { if (proxyname) { conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; @@ -1843,8 +1839,10 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } - } - else if (!conn->hostname) { + } else 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 = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport;