php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch fpm-balancer for FPM related Bug #62172Patch version 2012-05-28 00:50 UTC Return to Bug #62172 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: jdr@alexanderinteractive.com--- php-5.4.3/sapi/fpm/fpm/fpm_main.c.balancer 2012-05-08 01:22:56.000000000 -0400 +++ php-5.4.3/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,22 @@ 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; + } + } + if (CGIG(fix_pathinfo)) { struct stat st; char *real_path = NULL; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Nov 21 20:01:29 2024 UTC |