From 520dcd80a45ce237e9a46ee28697e1b8af3fcd7e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 2 Sep 2021 12:37:02 +0000 Subject: [PATCH] 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 --- changes-entries/fix_uds_filename.txt | 2 ++ modules/proxy/proxy_util.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changes-entries/fix_uds_filename.txt 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'; -- 2.47.3