]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Standardize on:
authorJim Jagielski <jim@apache.org>
Tue, 15 Oct 2013 15:38:09 +0000 (15:38 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 15 Oct 2013 15:38:09 +0000 (15:38 +0000)
   unix:/path/to/socket|scheme://ignored

for ProxyPass UDS.

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

docs/manual/mod/mod_proxy.xml
modules/proxy/proxy_util.c

index fce53667e03c2e051b579513edf78d71870a6501..293aab504e14f13e2e6dc184a68ad94113a9dd27 100644 (file)
@@ -823,13 +823,14 @@ expressions</description>
     <directive>ProxyPass</directive>.</note>
 
     <p>Support for using a Unix Domain Socket is available by using a target
-    which appends <code>|sock:/path/lis.sock</code>. For example, to proxy
+    which prepends <code>unix:/path/lis.sock|</code>. For example, to proxy
     HTTP and target the UDS at /home/www/socket you would use
-    <code>http://localhost/|sock:/home/www.socket</code>.</p>
+    <code>unix:/home/www.socket|http://localhost/</code>.</p>
 
     <note><strong>Note: </strong>When using Unix Domain Sockets, the hostname and path
-    associated with the 1st URL (<code>http://localhost/</code> in the above
-    example) is ignored; the path associated with the <code>sock:</code>
+    associated with the 2nd URL (<code>http://localhost/</code> in the above
+    example) is ignored; only the scheme is significant.
+    The path associated with the <code>unix:</code>
     URL is <directive>DefaultRuntimeDir</directive> aware.</note>
 
     <p>Suppose the local server has address <code>http://example.com/</code>;
index a02af850e8155a40f104b8e86a3481e2ce827703..1b7fbd3377644676509a452ceb268b75897bc856 100644 (file)
@@ -1508,7 +1508,7 @@ PROXY_DECLARE(char *) ap_proxy_worker_name(apr_pool_t *p,
     if (rv != APR_SUCCESS) {
         return apr_pstrcat(pool, worker->s->name, "|", NULL);
     }
-    return apr_pstrcat(pool, uri.scheme, "://localhost/|sock:", uri.path, NULL);
+    return apr_pstrcat(pool, "unix:", uri.path, "|", uri.scheme, ":", NULL);
 }
 
 PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p,
@@ -1610,15 +1610,16 @@ 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://ignored/ignored|sock:/path/foo/bar.sock
+       require format: unix:/path/foo/bar.sock|http:
        This results in talking http to the socket at /path/foo/bar.sock
     */
     ptr = ap_strchr((char *)url, '|');
     if (ptr) {
         *ptr = '\0';
-        rv = apr_uri_parse(p, ptr+1, &urisock);
-        if (rv == APR_SUCCESS && !strcasecmp(urisock.scheme, "sock")) {
+        rv = apr_uri_parse(p, url, &urisock);
+        if (rv == APR_SUCCESS && !strcasecmp(urisock.scheme, "unix")) {
             sockpath = urisock.path;
+            url = ptr+1;    /* so we get the scheme for the uds */
         }
         else {
             *ptr = '|';
@@ -1627,14 +1628,14 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p,
     rv = apr_uri_parse(p, url, &uri);
 
     if (rv != APR_SUCCESS) {
-        return "Unable to parse URL";
+        return apr_pstrcat(p, "Unable to parse URL: ", url, NULL);
     }
     if (!uri.scheme) {
-        return "URL must be absolute!";
+        return apr_pstrcat(p, "URL must be absolute!: ", url, NULL);
     }
     /* allow for http:|sock:/path */
     if (!uri.hostname && !sockpath) {
-        return "URL must be absolute!";
+        return apr_pstrcat(p, "URL must be absolute!: ", url, NULL);;
     }
 
     if (sockpath) {