]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Optimize code: We know that we already have a valid encoding string,
authorRuediger Pluem <rpluem@apache.org>
Fri, 10 Feb 2023 16:17:54 +0000 (16:17 +0000)
committerRuediger Pluem <rpluem@apache.org>
Fri, 10 Feb 2023 16:17:54 +0000 (16:17 +0000)
  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

modules/proxy/proxy_util.c

index e4d9df9c4866439aa78ea44cb24e7c6a56e6e1cd..3dacec38ee27a5e4f4266e57e49ccbe9cbfd64f4 100644 (file)
@@ -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)) {