httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r797603 - /httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c
Date Fri, 24 Jul 2009 18:54:39 GMT
Author: wrowe
Date: Fri Jul 24 18:54:39 2009
New Revision: 797603

URL: http://svn.apache.org/viewvc?rev=797603&view=rev
Log:
Remove hop by hop headers and set Connection: close to convince
all fastcgi consumers that they are not responsible for the various
processing which httpd has already performed, internally.

Modified:
    httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c

Modified: httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c?rev=797603&r1=797602&r2=797603&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c (original)
+++ httpd/mod_fcgid/trunk/mod_fcgid/mod_fcgid.c Fri Jul 24 18:54:39 2009
@@ -207,6 +207,17 @@
     ap_add_cgi_vars(r);
     fcgid_add_cgi_vars(r);
 
+    /* Remove hop-by-hop headers handled by http
+     */
+    apr_table_unset(r->subprocess_env, "HTTP_KEEP_ALIVE");
+    apr_table_unset(r->subprocess_env, "HTTP_TE");
+    apr_table_unset(r->subprocess_env, "HTTP_TRAILER");
+    apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
+    apr_table_unset(r->subprocess_env, "HTTP_UPGRADE");
+
+    /* Connection hop-by-hop header to prevent the CGI from hanging */
+    apr_table_set(r->subprocess_env, "HTTP_CONNECTION", "close");
+
     /* Insert output filter */
     ap_add_output_filter_handle(fcgid_filter_handle, NULL, r,
                                 r->connection);
@@ -260,12 +271,22 @@
     apr_table_setn(r->subprocess_env, "REMOTE_PASSWD", password);
     apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHENTICATOR");
 
-    /* Remove some environment variables */
-    /* The Web server does not send CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED, and SCRIPT_NAME
headers */
+    /* Drop the variables CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED,
+     * SCRIPT_NAME and most Hop-By-Hop headers - EXCEPT we will pass
+     * PROXY_AUTH to allow CGI to perform proxy auth for httpd
+     */
     apr_table_unset(r->subprocess_env, "CONTENT_LENGTH");
     apr_table_unset(r->subprocess_env, "PATH_INFO");
     apr_table_unset(r->subprocess_env, "PATH_TRANSLATED");
     apr_table_unset(r->subprocess_env, "SCRIPT_NAME");
+    apr_table_unset(r->subprocess_env, "HTTP_KEEP_ALIVE");
+    apr_table_unset(r->subprocess_env, "HTTP_TE");
+    apr_table_unset(r->subprocess_env, "HTTP_TRAILER");
+    apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
+    apr_table_unset(r->subprocess_env, "HTTP_UPGRADE");
+
+    /* Connection hop-by-hop header to prevent the CGI from hanging */
+    apr_table_set(r->subprocess_env, "HTTP_CONNECTION", "close");
 
     /* Handle the request */
     res =
@@ -340,12 +361,22 @@
     fcgid_add_cgi_vars(r);
     apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE", "AUTHORIZER");
 
-    /* Remove some environment variables */
-    /* The Web server does not send CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED, and SCRIPT_NAME
headers */
+    /* Drop the variables CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED,
+     * SCRIPT_NAME and most Hop-By-Hop headers - EXCEPT we will pass
+     * PROXY_AUTH to allow CGI to perform proxy auth for httpd
+     */
     apr_table_unset(r->subprocess_env, "CONTENT_LENGTH");
     apr_table_unset(r->subprocess_env, "PATH_INFO");
     apr_table_unset(r->subprocess_env, "PATH_TRANSLATED");
     apr_table_unset(r->subprocess_env, "SCRIPT_NAME");
+    apr_table_unset(r->subprocess_env, "HTTP_KEEP_ALIVE");
+    apr_table_unset(r->subprocess_env, "HTTP_TE");
+    apr_table_unset(r->subprocess_env, "HTTP_TRAILER");
+    apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
+    apr_table_unset(r->subprocess_env, "HTTP_UPGRADE");
+
+    /* Connection hop-by-hop header to prevent the CGI from hanging */
+    apr_table_set(r->subprocess_env, "HTTP_CONNECTION", "close");
 
     /* Handle the request */
     res =
@@ -421,12 +452,22 @@
     apr_table_setn(r->subprocess_env, "FCGI_APACHE_ROLE",
                    "ACCESS_CHECKER");
 
-    /* Remove some environment variables */
-    /* The Web server does not send CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED, and SCRIPT_NAME
headers */
+    /* Drop the variables CONTENT_LENGTH, PATH_INFO, PATH_TRANSLATED,
+     * SCRIPT_NAME and most Hop-By-Hop headers - EXCEPT we will pass
+     * PROXY_AUTH to allow CGI to perform proxy auth for httpd
+     */
     apr_table_unset(r->subprocess_env, "CONTENT_LENGTH");
     apr_table_unset(r->subprocess_env, "PATH_INFO");
     apr_table_unset(r->subprocess_env, "PATH_TRANSLATED");
     apr_table_unset(r->subprocess_env, "SCRIPT_NAME");
+    apr_table_unset(r->subprocess_env, "HTTP_KEEP_ALIVE");
+    apr_table_unset(r->subprocess_env, "HTTP_TE");
+    apr_table_unset(r->subprocess_env, "HTTP_TRAILER");
+    apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
+    apr_table_unset(r->subprocess_env, "HTTP_UPGRADE");
+
+    /* Connection hop-by-hop header to prevent the CGI from hanging */
+    apr_table_set(r->subprocess_env, "HTTP_CONNECTION", "close");
 
     /* Handle the request */
     res =



Mime
View raw message