]> granicus.if.org Git - apache/commitdiff
Until we determine whether we should dip into the connection
authorJim Jagielski <jim@apache.org>
Thu, 1 Dec 2005 13:50:11 +0000 (13:50 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 1 Dec 2005 13:50:11 +0000 (13:50 +0000)
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

index dd7e0b83c38da70c8d5ecf41d02c803ffc1540a6..4877e909b836c1bedede5726d695c03971936cc4 100644 (file)
@@ -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;