]> granicus.if.org Git - apache/commitdiff
proxy_fcgi: remove FPM-specific logic
authorJacob Champion <jchampion@apache.org>
Thu, 29 Jun 2017 17:43:48 +0000 (17:43 +0000)
committerJacob Champion <jchampion@apache.org>
Thu, 29 Jun 2017 17:43:48 +0000 (17:43 +0000)
Reverts r1780328, r1780329, and their associated followups, which
incorrectly manipulated SCRIPT_NAME by default. All proxy_fcgi.t
regression tests now pass.

PR: 61202

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

CHANGES
modules/mappers/mod_actions.c
modules/proxy/mod_proxy_fcgi.c

diff --git a/CHANGES b/CHANGES
index 716fa113bf986b91963cd5ee744c17dff9145111..ce017d2acbb57c47cc98c3a0faf15f8c0ede792a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_fcgi: Revert to 2.4.20 FCGI behavior for the default
+     ProxyFCGIBackendType, fixing a regression with PHP-FPM. PR 61202.
+     [Jacob Champion]
+
   *) core: Avoid duplicate HEAD in Allow header.
      This is a regression in 2.4.24 (unreleased), 2.4.25 and 2.4.26.
      PR 61207. [Christophe Jaillet]
index ac9c3b7428fbceefdfe6e74b7d93f91e67f6e32c..2a67a2742ae0a2152824d41174168519f51d27dc 100644 (file)
@@ -186,8 +186,7 @@ static int action_handler(request_rec *r)
         ap_field_noparam(r->pool, r->content_type);
 
     if (action && (t = apr_table_get(conf->action_types, action))) {
-        int virtual = (*t++ == '0' ? 0 : 1);
-        if (!virtual && r->finfo.filetype == APR_NOFILE) {
+        if (*t++ == '0' && r->finfo.filetype == APR_NOFILE) {
             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(00652)
                           "File does not exist: %s", r->filename);
             return HTTP_NOT_FOUND;
@@ -198,9 +197,6 @@ static int action_handler(request_rec *r)
          * (will be REDIRECT_HANDLER there)
          */
         apr_table_setn(r->subprocess_env, "HANDLER", action);
-        if (virtual) {
-            apr_table_setn(r->notes, "virtual_script", "1");
-        }
     }
 
     if (script == NULL)
index 8bf84c614b8f639790c63e6d69cdaffe24658b73..41292e8726756d94fe4974b1f4abe66e67a59f87 100644 (file)
@@ -321,7 +321,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     apr_status_t rv;
     apr_size_t avail_len, len, required_len;
     int next_elem, starting_elem;
-    int fpm = 0;
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
     fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config, &proxy_fcgi_module);
 
@@ -354,8 +353,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
                     *qs = '\0';
                 }
             }
-        } else {
-            fpm = 1;
         }
 
         if (newfname) {
@@ -364,38 +361,9 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
         }
     }
 
-#if 0
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                  "r->filename: %s", (r->filename ? r->filename : "nil"));
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                  "r->uri: %s", (r->uri ? r->uri : "nil"));
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                  "r->path_info: %s", (r->path_info ? r->path_info : "nil"));
-#endif
-
     ap_add_common_vars(r);
     ap_add_cgi_vars(r);
 
-    if (fpm || apr_table_get(r->notes, "virtual_script")) {
-        /*
-         * Adjust SCRIPT_NAME, PATH_INFO and PATH_TRANSLATED for PHP-FPM
-         * TODO: Right now, PATH_INFO and PATH_TRANSLATED look OK...
-         */
-        const char *pend;
-        const char *script_name = apr_table_get(r->subprocess_env, "SCRIPT_NAME");
-        pend = script_name + strlen(script_name);
-        if (r->path_info && *r->path_info) {
-            pend = script_name + ap_find_path_info(script_name, r->path_info) - 1;
-        }
-        while (pend != script_name && *pend != '/') {
-            pend--;
-        }
-        apr_table_setn(r->subprocess_env, "SCRIPT_NAME", pend);
-        ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
-                      "fpm:virtual_script: Modified SCRIPT_NAME to: %s",
-                      pend);
-    }
-
     /* XXX are there any FastCGI specific env vars we need to send? */
 
     /* Give admins final option to fine-tune env vars */