From: Eric Covener Date: Mon, 22 Dec 2014 15:39:54 +0000 (+0000) Subject: Change the return value to const, so the const non-matching input can just be X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed4016fba3dcdec848f97fc99119327fd8a974a9;p=thirdparty%2Fapache%2Fhttpd.git Change the return value to const, so the const non-matching input can just be returned. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647334 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 8ac3e47f241..26c37b6fecd 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1486,24 +1486,23 @@ static const char * return add_proxy(cmd, dummy, f1, r1, 1); } -PROXY_DECLARE(char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) +PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) { - char *ptr; + const char *ptr; /* * We could be passed a URL during the config stage that contains * the UDS path... ignore it */ - char *url_copy = apr_pstrdup(p, url); if (!strncasecmp(url, "unix:", 5) && - ((ptr = ap_strchr(url_copy, '|')) != NULL)) { + ((ptr = ap_strchr_c(url, '|')) != NULL)) { /* move past the 'unix:...|' UDS path info */ - char *ret, *c; + const char *ret, *c; ret = ptr + 1; /* special case: "unix:....|scheme:" is OK, expand * to "unix:....|scheme://localhost" * */ - c = ap_strchr(ret, ':'); + c = ap_strchr_c(ret, ':'); if (c == NULL) { return NULL; } @@ -1514,7 +1513,7 @@ PROXY_DECLARE(char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) return ret; } } - return url_copy; + return url; } static const char * diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index dfd80049dea..9a5bb673835 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -1076,7 +1076,7 @@ PROXY_DECLARE(apr_port_t) ap_proxy_port_of_scheme(const char *scheme); * @param url a URL potentially prefixed with a UDS path * @return URL with the UDS prefix removed */ -PROXY_DECLARE(char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url); +PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url); extern module PROXY_DECLARE_DATA proxy_module;