]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Change the return value to const, so the const non-matching input can just be
authorEric Covener <covener@apache.org>
Mon, 22 Dec 2014 15:39:54 +0000 (15:39 +0000)
committerEric Covener <covener@apache.org>
Mon, 22 Dec 2014 15:39:54 +0000 (15:39 +0000)
returned.

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

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h

index 8ac3e47f241b1669d392f9d53e5d6feb844e4bfe..26c37b6fecdcb2a8e55de06aa296e486e8c37c73 100644 (file)
@@ -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 *
index dfd80049dea51f602646d98af9058351cf172930..9a5bb673835bb29571c4bd3242117e32b65da076 100644 (file)
@@ -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;