httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r367208 - /httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
Date Mon, 09 Jan 2006 05:43:10 GMT
Author: rooneg
Date: Sun Jan  8 21:43:07 2006
New Revision: 367208

URL: http://svn.apache.org/viewcvs?rev=367208&view=rev
Log:
After more comparison with existing mod_proxy backends, such as http
it seems clear that we're going to need to be able to specify arbitrary
portions of the URL that need to be added to the path info.  Follow the
lead of mod_proxy_http and add the calculation of this into the canon
handler.

* modules/proxy/mod_proxy_fcgi.c
  (proxy_fcgi_canon): Add the path portion of the back end URL to the
   path_info of the request, via the ap_proxy_canonenc function.

Modified:
    httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c?rev=367208&r1=367207&r2=367208&view=diff
==============================================================================
--- httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c Sun Jan  8 21:43:07
2006
@@ -28,8 +28,7 @@
 static int proxy_fcgi_canon(request_rec *r, char *url)
 {
     char *host, sport[7];
-    const char *err;
-    const char* scheme;
+    const char *err, *scheme, *path;
     apr_port_t port = 8000;
 
     if (strncasecmp(url, "fcgi-", 5) == 0) {
@@ -61,11 +60,16 @@
             /* if literal IPv6 address */
             host = apr_pstrcat(r->pool, "[", host, "]", NULL);
         }
-        
+
+        path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
+                                 r->proxyreq);
+        if (path == NULL)
+            return HTTP_BAD_REQUEST;
+
         r->filename = apr_pstrcat(r->pool, "proxy:", scheme, host, sport, "/",
-                                  NULL);
+                                  path, NULL);
 
-        r->path_info = apr_pstrdup(r->pool, url);
+        r->path_info = apr_pstrcat(r->pool, "/", path, NULL);
     }
     else if (strncmp(url, "local://", 8) == 0) {
         url += 6;



Mime
View raw message