httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r106195 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/modules/generators/mod_cgi.c
Date Mon, 22 Nov 2004 16:03:23 GMT
Author: jorton
Date: Mon Nov 22 08:03:20 2004
New Revision: 106195

Modified:
   httpd/httpd/trunk/CHANGES
   httpd/httpd/trunk/modules/generators/mod_cgi.c
Log:
* modules/generators/mod_cgi.c (cgi_handler): Ensure all stderr from
the script is logged if it generated a non-local redirect.

PR: 20111


Modified: httpd/httpd/trunk/CHANGES
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?view=diff&rev=106195&p1=httpd/httpd/trunk/CHANGES&r1=106194&p2=httpd/httpd/trunk/CHANGES&r2=106195
==============================================================================
--- httpd/httpd/trunk/CHANGES	(original)
+++ httpd/httpd/trunk/CHANGES	Mon Nov 22 08:03:20 2004
@@ -2,6 +2,10 @@
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_cgi: Ensure that all stderr is logged for a script which returns
+     a Location header to generate a non-local redirect.  PR 20111.
+     [Joe Orton]
+
   *) Added the Event MPM to more efficiently handle clients during a 
      Keep Alive request.
      [Paul Querna, Greg Ames]

Modified: httpd/httpd/trunk/modules/generators/mod_cgi.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/generators/mod_cgi.c?view=diff&rev=106195&p1=httpd/httpd/trunk/modules/generators/mod_cgi.c&r1=106194&p2=httpd/httpd/trunk/modules/generators/mod_cgi.c&r2=106195
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgi.c	(original)
+++ httpd/httpd/trunk/modules/generators/mod_cgi.c	Mon Nov 22 08:03:20 2004
@@ -925,11 +925,17 @@
 
         location = apr_table_get(r->headers_out, "Location");
 
-        if (location && location[0] == '/' && r->status == 200) {
+        if (location && r->status == 200) {
+            /* For a redirect whether internal or not, discard any
+             * remaining stdout from the script, and log any remaining
+             * stderr output, as normal. */
             discard_script_output(bb);
             apr_brigade_destroy(bb);
             apr_file_pipe_timeout_set(script_err, r->server->timeout);
             log_script_err(r, script_err);
+        }
+
+        if (location && location[0] == '/' && r->status == 200) {
             /* This redirect needs to be a GET no matter what the original
              * method was.
              */
@@ -949,8 +955,6 @@
             /* XX Note that if a script wants to produce its own Redirect
              * body, it now has to explicitly *say* "Status: 302"
              */
-            discard_script_output(bb);
-            apr_brigade_destroy(bb);
             return HTTP_MOVED_TEMPORARILY;
         }
 

Mime
View raw message