You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2013/10/14 16:59:39 UTC
svn commit: r1531929 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Author: jim
Date: Mon Oct 14 14:59:38 2013
New Revision: 1531929
URL: http://svn.apache.org/r1531929
Log:
clean up socket definition... just the sock: path matters,
and we adjust relative to DefaultRuntimeDir
Modified:
httpd/httpd/trunk/modules/proxy/proxy_util.c
Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1531929&r1=1531928&r2=1531929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Oct 14 14:59:38 2013
@@ -1586,8 +1586,8 @@ PROXY_DECLARE(char *) ap_proxy_define_wo
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_wo
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