|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch fpm-balancer-v2 for FPM related Bug #62172Patch version 2014-02-01 19:42 UTC Return to Bug #62172 | Download this patchThis patch is obsolete Obsoleted by patches: This patch renders other patches obsolete Obsolete patches: Patch Revisions:Developer: matt@haught.org
--- sapi/fpm/fpm/fpm_main.c.balancer 2012-05-08 01:22:56.000000000 -0400
+++ sapi/fpm/fpm/fpm_main.c 2012-05-27 17:54:42.958772555 -0400
@@ -1059,6 +1059,7 @@ static void init_request_info(TSRMLS_D)
}
#define APACHE_PROXY_FCGI_PREFIX "proxy:fcgi://"
+#define APACHE_PROXY_BALANCER_PREFIX "proxy:balancer://"
/* Fix proxy URLs in SCRIPT_FILENAME generated by Apache mod_proxy_fcgi:
* proxy:fcgi://localhost:9000/some-dir/info.php/test
* should be changed to:
@@ -1082,6 +1083,27 @@ static void init_request_info(TSRMLS_D)
}
}
+ if (env_script_filename &&
+ strncasecmp(env_script_filename, APACHE_PROXY_BALANCER_PREFIX, sizeof(APACHE_PROXY_BALANCER_PREFIX) - 1) == 0) {
+ /* advance to first character of hostname */
+ char *p = env_script_filename + (sizeof(APACHE_PROXY_BALANCER_PREFIX) - 1);
+ while (*p != '\0' && *p != '/') {
+ p++; /* move past hostname and port */
+ }
+ if (*p != '\0') {
+ /* Copy path portion in place to avoid memory leak. Note
+ * that this also affects what script_path_translated points
+ * to. */
+ memmove(env_script_filename, p, strlen(p) + 1);
+ apache_was_here = 1;
+ }
+ /* ignore query string if sent by Apache (RewriteRule) */
+ p = strchr(env_script_filename, '?');
+ if (p) {
+ *p =0;
+ }
+ }
+
if (CGIG(fix_pathinfo)) {
struct stat st;
char *real_path = NULL;
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 13:00:01 2025 UTC |