ASF Bugzilla – Attachment 32257 Details for
Bug 51517
mod_proxy_fcgi is not RFC 3875 compliant (SCRIPT_FILENAME, PATH_INFO, ...)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Combined Patch for Apache 2.4.10. Contains the other, older patches.
combined_patch_v2.patch (text/plain), 3.39 KB, created by
Stefan Rubner
on 2014-12-03 20:54:29 UTC
(
hide
)
Description:
Combined Patch for Apache 2.4.10. Contains the other, older patches.
Filename:
MIME Type:
Creator:
Stefan Rubner
Created:
2014-12-03 20:54:29 UTC
Size:
3.39 KB
patch
obsolete
>Description: Make mod_proxy_balancer and mod_proxy_fcgi RFC 3875 complient > >--- apache2-2.4.10.orig/modules/proxy/mod_proxy_balancer.c >+++ apache2-2.4.10/modules/proxy/mod_proxy_balancer.c >@@ -101,7 +101,23 @@ static int proxy_balancer_canon(request_ > r->filename = apr_pstrcat(r->pool, "proxy:", BALANCER_PREFIX, host, > "/", path, (search) ? "?" : "", (search) ? search : "", NULL); > >- r->path_info = apr_pstrcat(r->pool, "/", path, NULL); >+ /* According to RFC 3875 PATH_INFO should contain the portion >+ * of the URI to be interpreted by the FCGI script. In general >+ * terms that would be the portion _after_ the script name. >+ */ >+ // r->path_info = apr_pstrcat(r->pool, "/", path, NULL); >+ int sru_p = 0; >+ while ( path[sru_p] != '.' && sru_p < strlen(path)) { sru_p++; } // search for first '.' >+ while ( path[sru_p] && ((path[sru_p] != '/') && (path[sru_p] != '?')) && sru_p < strlen(path)) { >+ sru_p++; >+ } >+ if (sru_p && path[sru_p]) { >+ if (search) { >+ r->path_info = apr_pstrcat(r->pool, apr_pstrndup(r->pool, path + sru_p, strlen(path) - sru_p), "?", search, NULL); >+ } else { >+ r->path_info = apr_pstrndup(r->pool, path + sru_p, strlen(path) - sru_p); >+ } >+ } > > return OK; > } >--- apache2-2.4.10.orig/modules/proxy/mod_proxy_fcgi.c >+++ apache2-2.4.10/modules/proxy/mod_proxy_fcgi.c >@@ -76,11 +76,27 @@ static int proxy_fcgi_canon(request_rec > ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01060) > "set r->filename to %s", r->filename); > >- if (apr_table_get(r->subprocess_env, "proxy-fcgi-pathinfo")) { >- r->path_info = apr_pstrcat(r->pool, "/", path, NULL); >- >- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01061) >- "set r->path_info to %s", r->path_info); >+ /* According to RFC 3875 PATH_INFO should contain the portion >+ * of the URI to be interpreted by the FCGI script. In general >+ * terms that would be the portion _after_ the script name. >+ */ >+ // if (apr_table_get(r->subprocess_env, "proxy-fcgi-pathinfo")) { >+ // r->path_info = apr_pstrcat(r->pool, "/", path, NULL); >+ // >+ // ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01061) >+ // "set r->path_info to %s", r->path_info); >+ //} >+ int sru_p = 0; >+ while ( path[sru_p] != '.' && sru_p < strlen(path)) { sru_p++; } // search for first '.' >+ while ( path[sru_p] && ((path[sru_p] != '/') && (path[sru_p] != '?')) && sru_p < strlen(path)) { >+ sru_p++; >+ } >+ if (sru_p && path[sru_p]) { >+ if (r->args) { >+ r->path_info = apr_pstrcat(r->pool, apr_pstrndup(r->pool, path + sru_p, strlen(path) - sru_p), "?", r->args, NULL); >+ } else { >+ r->path_info = apr_pstrndup(r->pool, path + sru_p, strlen(path) - sru_p); >+ } > } > > return OK; >--- apache2-2.4.10.orig/server/util_script.c >+++ apache2-2.4.10/server/util_script.c >@@ -297,6 +297,13 @@ AP_DECLARE(int) ap_find_path_info(const > int lu = strlen(uri); > int lp = strlen(path_info); > >+ /* Since path_info may contain GET vars we need to >+ * skip those first >+ */ >+ if strchr(path_info, '?') { >+ while (path_info[--lp] != '?') { } >+ /* lp--; */ >+ } > while (lu-- && lp-- && uri[lu] == path_info[lp]) { > if (path_info[lp] == '/') { > while (lu && uri[lu-1] == '/') lu--;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51517
:
32253
|
32254
| 32257