]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy: Faster unix socket path parsing in the "proxy:" URL.
authorYann Ylavic <ylavic@apache.org>
Thu, 2 Sep 2021 12:37:02 +0000 (12:37 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 2 Sep 2021 12:37:02 +0000 (12:37 +0000)
The actual r->filename format is "[proxy:]unix:path|url" for UDS, no need to
strstr(,"unix:") since it's at the start of the string.

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

changes-entries/fix_uds_filename.txt [new file with mode: 0644]
modules/proxy/proxy_util.c

diff --git a/changes-entries/fix_uds_filename.txt b/changes-entries/fix_uds_filename.txt
new file mode 100644 (file)
index 0000000..d6c3471
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mod_proxy: Faster unix socket path parsing in the "proxy:" URL.
+     [Yann Ylavic]
index 86acaba2112bbcb041f51a5f4449d2df11ece892..c78e1e2b0385ab13b2c1411281e4d669bd3c3de7 100644 (file)
@@ -2274,8 +2274,8 @@ static void fix_uds_filename(request_rec *r, char **url)
     if (!r || !r->filename) return;
 
     if (!strncmp(r->filename, "proxy:", 6) &&
-            (ptr2 = ap_strcasestr(r->filename, "unix:")) &&
-            (ptr = ap_strchr(ptr2, '|'))) {
+            !ap_cstr_casecmpn(r->filename + 6, "unix:", 5) &&
+            (ptr2 = r->filename + 6 + 5, ptr = ap_strchr(ptr2, '|'))) {
         apr_uri_t urisock;
         apr_status_t rv;
         *ptr = '\0';