From: Jim Jagielski Date: Fri, 18 Apr 2014 19:21:35 +0000 (+0000) Subject: strncmp(r->filename, "proxy:", 6) is faster than a X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ef8f817421f36205660117ba44e8f0b1294fd7;p=thirdparty%2Fapache%2Fhttpd.git strncmp(r->filename, "proxy:", 6) is faster than a 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 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 1d41d4e1a4a..7d024961f9c 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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; } diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index a0845827042..2c16318f794 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -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; diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 6af0ac430ff..f57f208e44d 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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;