From: Yann Ylavic Date: Sun, 20 Oct 2019 12:31:45 +0000 (+0000) Subject: mod_proxy_http: revert r1868625. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd9685dbfcee8081536ba7d6a399638e04c65d6a;p=apache mod_proxy_http: revert r1868625. The HTTP_IN filter handles "100 Continue" the first time it's called only, and in spool_reqbody_cl() we have already tried to prefetch the body, so it's too late. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868652 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 1f72688f2e..152da01433 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -431,18 +431,18 @@ static int spool_reqbody_cl(proxy_http_req_t *req, apr_off_t *bytes_spooled) apr_file_t *tmpfile = NULL; apr_off_t limit; - /* - * Tell the HTTP_IN filter that it should send a "100 continue" if the - * client expects one, before blocking on the body, otherwise we'd wait - * for each other. + /* Send "100 Continue" now if the client expects one, before + * blocking on the body, otherwise we'd wait for each other. */ if (req->expecting_100) { - /* From https://tools.ietf.org/html/rfc7231#section-5.1.1 - * A server MAY omit sending a 100 (Continue) response if it has - * already received some or all of the message body for the - * corresponding request, or if [snip]. - */ - r->expecting_100 = APR_BRIGADE_EMPTY(input_brigade); + int saved_status = r->status; + + r->expecting_100 = 1; + r->status = HTTP_CONTINUE; + ap_send_interim_response(r, 0); + AP_DEBUG_ASSERT(!r->expecting_100); + + r->status = saved_status; req->expecting_100 = 0; }