From 2aa898bb2f40a78d5c94d2a5a5efaf5296552b13 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 18 Apr 2014 19:21:35 +0000 Subject: [PATCH] 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 --- modules/mappers/mod_rewrite.c | 1 - modules/proxy/mod_proxy.c | 1 - modules/proxy/proxy_util.c | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 1d41d4e1a4..7d024961f9 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 a084582704..2c16318f79 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 6af0ac430f..f57f208e44 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; -- 2.50.1