diff options
author | Ruediger Pluem <rpluem@apache.org> | 2023-02-10 17:17:54 +0100 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2023-02-10 17:17:54 +0100 |
commit | 7e5010b3cbfb25f5347ac888bf8961e41556b8f1 (patch) | |
tree | b622c2b867061b52ad76a7e75d31cfe9db3d3a9e /modules/proxy/proxy_util.c | |
parent | Further migration of tests to GHA, though HTTP/2, ACME and (diff) | |
download | apache2-7e5010b3cbfb25f5347ac888bf8961e41556b8f1.tar.xz apache2-7e5010b3cbfb25f5347ac888bf8961e41556b8f1.zip |
* Optimize code: We know that we already have a valid encoding string,
because we just decoded it. Hence just copy what we have instead of
redoing it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907565 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/proxy_util.c')
-rw-r--r-- | modules/proxy/proxy_util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index e4d9df9c48..3dacec38ee 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -261,12 +261,13 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, return NULL; } ch = ap_proxy_hex2c(&x[i + 1]); - i += 2; if (ch != 0 && strchr(reserved, ch)) { /* keep it encoded */ - ap_proxy_c2hex(ch, &y[j]); - j += 2; + y[j++] = x[i++]; + y[j++] = x[i++]; + y[j] = x[i]; continue; } + i += 2; } /* recode it, if necessary */ if (!apr_isalnum(ch) && !strchr(allowed, ch)) { |