summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-28 12:32:25 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-28 12:32:25 +0000
commitb36b129f346ccf191069b5117d631a77a4b74502 (patch)
tree238a928ce0734d6fce904cc9a09932bf2ff58f6a
parent4afce44d844474ee7190c1c5e0eadb0d91483dcf (diff)
downloadhttpd-b36b129f346ccf191069b5117d631a77a4b74502.tar.gz
mod_cgi[d]: Close the connection after handling nph- scripts.
The HTTP output filters chain is bypassed for nph- scripts (whatever this means), so there is no way to know whether the connection is reusable after sending the cgi response (opaque header + body). Set r->connection->keepalive = AP_CONN_CLOSE unconditionally. For instance test frameork's "nph-foldhdr.pl" script responds with HTTP/1.0 and no Content-Length so closing the connection is the only way to detect the end of response for the peer. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897563 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/generators/cgi_common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/generators/cgi_common.h b/modules/generators/cgi_common.h
index 69df73ce68..7aaf9b2793 100644
--- a/modules/generators/cgi_common.h
+++ b/modules/generators/cgi_common.h
@@ -524,6 +524,9 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
}
r->output_filters = r->proto_output_filters = cur;
+ /* Dunno about the reusability of the connection either, so don't */
+ r->connection->keepalive = AP_CONN_CLOSE;
+
rv = ap_pass_brigade(r->output_filters, bb);
}