From 76927e7a346cfd87425c708e021517f2784b189a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 14 Oct 2013 14:59:38 +0000 Subject: [PATCH] clean up socket definition... just the sock: path matters, and we adjust relative to DefaultRuntimeDir git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531929 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_util.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 75d4aed66c..8ece05ce9a 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1586,8 +1586,8 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p, char *ptr, *sockpath = NULL; /* Look to see if we are using UDS: - require format: http://localhost/whatever|sock:/path - This results in talking http to the socket at /whatever/path + require format: http://ignored/ignored|sock:/path/foo/bar.sock + This results in talking http to the socket at /path/foo/bar.sock */ ptr = ap_strchr((char *)url, '|'); if (ptr) { @@ -1605,17 +1605,24 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p, if (rv != APR_SUCCESS) { return "Unable to parse URL"; } - if (!uri.hostname || !uri.scheme) { + if (!uri.scheme) { + return "URL must be absolute!"; + } + /* allow for http:|sock:/path */ + if (!uri.hostname && !sockpath) { return "URL must be absolute!"; } - ap_str_tolower(uri.hostname); - ap_str_tolower(uri.scheme); if (sockpath) { uri.hostname = "localhost"; - uri.path = apr_pstrcat(p, uri.path, (*sockpath == '/' ? "" : "/"), - sockpath, NULL); + uri.path = ap_runtime_dir_relative(p, sockpath); + uri.query = NULL; + uri.fragment = NULL; } + else { + ap_str_tolower(uri.hostname); + } + ap_str_tolower(uri.scheme); /* * Workers can be associated w/ balancers or on their * own; ie: the generic reverse-proxy or a worker -- 2.40.0