summaryrefslogtreecommitdiffstats
path: root/server/protocol.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2019-10-18 09:50:59 +0200
committerYann Ylavic <ylavic@apache.org>2019-10-18 09:50:59 +0200
commitb936beed5c616a6254466f476555b70dbfadb826 (patch)
tree3ca62107a0ed6d78148bcd37c1cf166ac38209b1 /server/protocol.c
parent *) mod_md: Adding the several new features. (diff)
downloadapache2-b936beed5c616a6254466f476555b70dbfadb826.tar.xz
apache2-b936beed5c616a6254466f476555b70dbfadb826.zip
mod_proxy_http: Fix 100-continue deadlock for spooled request bodies. PR 63855.
Send "100 Continue", if needed, before fetching/blocking on the request body in spool_reqbody_cl(), otherwise mod_proxy and the client can wait for each other, leading to a request timeout (408). While at it, make so that ap_send_interim_response() uses the default status line if none is set in r->status_line. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868576 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/protocol.c')
-rw-r--r--server/protocol.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/server/protocol.c b/server/protocol.c
index d6872f69b8..4f1c6e4c67 100644
--- a/server/protocol.c
+++ b/server/protocol.c
@@ -2287,7 +2287,8 @@ static int send_header(void *data, const char *key, const char *val)
AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers)
{
hdr_ptr x;
- char *status_line = NULL;
+ char *response_line = NULL;
+ const char *status_line;
request_rec *rr;
if (r->proto_num < HTTP_VERSION(1,1)) {
@@ -2318,13 +2319,19 @@ AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers)
}
}
- status_line = apr_pstrcat(r->pool, AP_SERVER_PROTOCOL " ", r->status_line, CRLF, NULL);
- ap_xlate_proto_to_ascii(status_line, strlen(status_line));
+ status_line = r->status_line;
+ if (status_line == NULL) {
+ status_line = ap_get_status_line_ex(r->pool, r->status);
+ }
+ response_line = apr_pstrcat(r->pool,
+ AP_SERVER_PROTOCOL " ", status_line, CRLF,
+ NULL);
+ ap_xlate_proto_to_ascii(response_line, strlen(response_line));
x.f = r->connection->output_filters;
x.bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
- ap_fputs(x.f, x.bb, status_line);
+ ap_fputs(x.f, x.bb, response_line);
if (send_headers) {
apr_table_do(send_header, &x, r->headers_out, NULL);
apr_table_clear(r->headers_out);