httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r350250 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Thu, 01 Dec 2005 13:50:14 GMT
Author: jim
Date: Thu Dec  1 05:50:11 2005
New Revision: 350250

URL: http://svn.apache.org/viewcvs?rev=350250&view=rev
Log:
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.

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=350250&r1=350249&r2=350250&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Thu Dec  1 05:50:11 2005
@@ -1831,11 +1831,7 @@
      *
      * 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 @@
             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;



Mime
View raw message