]> granicus.if.org Git - apache/commitdiff
strncmp(r->filename, "proxy:", 6) is faster than a
authorJim Jagielski <jim@apache.org>
Fri, 18 Apr 2014 19:21:35 +0000 (19:21 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 18 Apr 2014 19:21:35 +0000 (19:21 +0000)
note. Plus, allows for checking even if not due to
rewrite.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588544 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_rewrite.c
modules/proxy/mod_proxy.c
modules/proxy/proxy_util.c

index 1d41d4e1a4a064df465064d7336855298a549dd3..7d024961f9c93859692c1f21b78841156afdbfd6 100644 (file)
@@ -4193,7 +4193,6 @@ static int apply_rewrite_rule(rewriterule_entry *p, rewrite_ctx *ctx)
                     r->filename));
 
         r->filename = apr_pstrcat(r->pool, "proxy:", r->filename, NULL);
-        apr_table_setn(r->notes, "rewrite-proxy", "1");
         return 1;
     }
 
index a08458270425b26cc86e676ff6e2ece34733799e..2c16318f7941680341842edb287b2b0d0bd38e87 100644 (file)
@@ -938,7 +938,6 @@ static int proxy_handler(request_rec *r)
             strncmp(r->filename, "proxy:", 6) != 0) {
             r->proxyreq = PROXYREQ_REVERSE;
             r->filename = apr_pstrcat(r->pool, r->handler, r->filename, NULL);
-            apr_table_setn(r->notes, "rewrite-proxy", "1");
         }
         else {
             return DECLINED;
index 6af0ac430ff3a3a016da2c8c4c997ea22d81698c..f57f208e44dc196ab7383795b03a20a2069928a2 100644 (file)
@@ -1949,11 +1949,8 @@ PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
                  * 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") &&
+                if (!strncmp(r->filename, "proxy:", 6) &&
                     (ptr2 = ap_strcasestr(r->filename, "unix:")) &&
                     (ptr = ap_strchr(ptr2, '|'))) {
                     apr_uri_t urisock;