You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2020/09/04 13:56:25 UTC

svn commit: r1881459 - /httpd/httpd/trunk/modules/generators/cgi_common.h

Author: jorton
Date: Fri Sep  4 13:56:25 2020
New Revision: 1881459

URL: http://svn.apache.org/viewvc?rev=1881459&view=rev
Log:
* modules/generators/cgi_common.h (cgi_handle_response): Avoid trying
  to read the output brigade twice in the case of a timeout.
  
PR: 64709

Modified:
    httpd/httpd/trunk/modules/generators/cgi_common.h

Modified: httpd/httpd/trunk/modules/generators/cgi_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/cgi_common.h?rev=1881459&r1=1881458&r2=1881459&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/cgi_common.h (original)
+++ httpd/httpd/trunk/modules/generators/cgi_common.h Fri Sep  4 13:56:25 2020
@@ -259,6 +259,13 @@ static int cgi_handle_response(request_r
         if ((ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
                                                         APLOG_MODULE_INDEX)))
         {
+            /* In the case of a timeout reading script output, clear
+             * the brigade to avoid a second attempt to read the
+             * output. */
+            if (ret == HTTP_GATEWAY_TIME_OUT) {
+                apr_brigade_cleanup(bb);
+            }
+
             ret = log_script(r, conf, ret, logdata, sbuf, bb, script_err);
 
             /*