From: Yann Ylavic Date: Thu, 2 Sep 2021 12:37:02 +0000 (+0000) Subject: mod_proxy: Faster unix socket path parsing in the "proxy:" URL. X-Git-Tag: 2.5.0-alpha2-ci-test-only~845 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=520dcd80a45ce237e9a46ee28697e1b8af3fcd7e;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy: Faster unix socket path parsing in the "proxy:" URL. 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 --- diff --git a/changes-entries/fix_uds_filename.txt b/changes-entries/fix_uds_filename.txt new file mode 100644 index 00000000000..d6c3471c7fb --- /dev/null +++ b/changes-entries/fix_uds_filename.txt @@ -0,0 +1,2 @@ + *) mod_proxy: Faster unix socket path parsing in the "proxy:" URL. + [Yann Ylavic] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 86acaba2112..c78e1e2b038 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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';