summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2020-09-04 15:56:25 +0200
committerJoe Orton <jorton@apache.org>2020-09-04 15:56:25 +0200
commit066f641991a92847dbb89ec57bc1c90df03b2ce6 (patch)
treeb83522d5ff45e49ecd43929d5678198a9ac763e2
parentBe consistent when handling OOM situation (diff)
downloadapache2-066f641991a92847dbb89ec57bc1c90df03b2ce6.tar.xz
apache2-066f641991a92847dbb89ec57bc1c90df03b2ce6.zip
* modules/generators/cgi_common.h (cgi_handle_response): Avoid trying
to read the output brigade twice in the case of a timeout. PR: 64709 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881459 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/generators/cgi_common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/generators/cgi_common.h b/modules/generators/cgi_common.h
index f97e7a2390..dc2bba962b 100644
--- a/modules/generators/cgi_common.h
+++ b/modules/generators/cgi_common.h
@@ -259,6 +259,13 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
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);
/*