httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1560546 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Wed, 22 Jan 2014 22:26:49 GMT
Author: jim
Date: Wed Jan 22 22:26:49 2014
New Revision: 1560546

URL: http://svn.apache.org/r1560546
Log:
Adjust url as required, following what we did to r->filename.
Save some cycles when searching...

Modified:
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1560546&r1=1560545&r2=1560546&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Wed Jan 22 22:26:49 2014
@@ -1927,9 +1927,9 @@ PROXY_DECLARE(int) ap_proxy_pre_request(
             }
         }
         else if (r->proxyreq == PROXYREQ_REVERSE) {
-            char *ptr;
-            const char *ptr2;
             if (conf->reverse) {
+                char *ptr;
+                char *ptr2;
                 ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
                               "*: found reverse proxy worker for %s", *url);
                 *balancer = NULL;
@@ -1946,10 +1946,13 @@ PROXY_DECLARE(int) ap_proxy_pre_request(
                  * In the case of the generic reverse proxy, we need to see if we
                  * were passed a UDS url (eg: from mod_proxy) and adjust uds_path
                  * as required.
+                 *
+                 * NOTE: Here we use a quick note lookup, but we could also
+                 * check to see if r->filename starts with 'proxy:'
                  */
                 if (apr_table_get(r->notes, "rewrite-proxy") &&
-                    (ptr2 = ap_strstr_c(r->filename, "unix:")) &&
-                    (ptr = ap_strchr(r->filename, '|'))) {
+                    (ptr2 = ap_strcasestr(r->filename, "unix:")) &&
+                    (ptr = ap_strchr(ptr2, '|'))) {
                     apr_uri_t urisock;
                     apr_status_t rv;
                     *ptr = '\0';
@@ -1961,6 +1964,9 @@ PROXY_DECLARE(int) ap_proxy_pre_request(
                             "worker uds path (%s) too long", sockpath);
                         }
                         r->filename = ptr+1;    /* so we get the scheme for the uds */
+                        *url = apr_pstrdup(r->pool, r->filename);
+                        ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
+                                      "*: rewrite of url due to UDS: %s", *url);
                     }
                     else {
                         *ptr = '|';



Mime
View raw message