From 48f938e0d6a64fcfd8bbd0a31b2c5e0c1b1f6df9 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 1 Dec 2005 13:50:11 +0000 Subject: [PATCH] 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 --- modules/proxy/proxy_util.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index dd7e0b83c3..4877e909b8 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; -- 2.40.0