You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2014/12/22 16:39:54 UTC
svn commit: r1647334 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.c
mod_proxy.h
Author: covener
Date: Mon Dec 22 15:39:54 2014
New Revision: 1647334
URL: http://svn.apache.org/r1647334
Log:
Change the return value to const, so the const non-matching input can just be
returned.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy.c
httpd/httpd/trunk/modules/proxy/mod_proxy.h
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1647334&r1=1647333&r2=1647334&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Mon Dec 22 15:39:54 2014
@@ -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_socket
return ret;
}
}
- return url_copy;
+ return url;
}
static const char *
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1647334&r1=1647333&r2=1647334&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Mon Dec 22 15:39:54 2014
@@ -1076,7 +1076,7 @@ PROXY_DECLARE(apr_port_t) ap_proxy_port_
* @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;