]> granicus.if.org Git - apache/commitdiff
mod_proxy_scgi: Support Unix sockets.
authorJeff Trawick <trawick@apache.org>
Mon, 5 May 2014 14:02:48 +0000 (14:02 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 5 May 2014 14:02:48 +0000 (14:02 +0000)
ap_proxy_port_of_scheme(): Support default SCGI port (4000).

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

CHANGES
modules/proxy/mod_proxy_scgi.c
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index bdb95428ef1c5a6737f964e9903a3f909e7c7b67..c5142edcd7a0534062927e85266c2d842d42bf65 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_scgi: Support Unix sockets.  ap_proxy_port_of_scheme():
+     Support default SCGI port (4000).  [Jeff Trawick]
+
   *) mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
      [Jeff Trawick]
 
index f77a986e2834f489b7897da846f5dbccc3dc19e3..6deae7888331b99e20d28e9a8b20b60aba8deb09 100644 (file)
@@ -176,13 +176,15 @@ static int scgi_canon(request_rec *r, char *url)
 {
     char *host, sport[sizeof(":65535")];
     const char *err, *path;
-    apr_port_t port = SCGI_DEFAULT_PORT;
+    apr_port_t port, def_port;
 
     if (strncasecmp(url, SCHEME "://", sizeof(SCHEME) + 2)) {
         return DECLINED;
     }
     url += sizeof(SCHEME); /* Keep slashes */
 
+    port = def_port = SCGI_DEFAULT_PORT;
+
     err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
     if (err) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00857)
@@ -190,7 +192,12 @@ static int scgi_canon(request_rec *r, char *url)
         return HTTP_BAD_REQUEST;
     }
 
-    apr_snprintf(sport, sizeof(sport), ":%u", port);
+    if (port != def_port) {
+        apr_snprintf(sport, sizeof(sport), ":%u", port);
+    }
+    else {
+        sport[0] = '\0';
+    }
 
     if (ap_strchr(host, ':')) { /* if literal IPv6 address */
         host = apr_pstrcat(r->pool, "[", host, "]", NULL);
index 917ee8db38dfb5ed9ceb80e8813f1aaeaaee9d95..23f998ead64264996affafee566b924347ea14b1 100644 (file)
@@ -3514,6 +3514,7 @@ static proxy_schemes_t pschemes[] =
 {
     {"fcgi",     8000},
     {"ajp",      AJP13_DEF_PORT},
+    {"scgi",     4000},
     { NULL, 0xFFFF }     /* unknown port */
 };