]> granicus.if.org Git - apache/commitdiff
mod_proxy_http: follow up to r1868576.
authorYann Ylavic <ylavic@apache.org>
Sat, 19 Oct 2019 13:58:16 +0000 (13:58 +0000)
committerYann Ylavic <ylavic@apache.org>
Sat, 19 Oct 2019 13:58:16 +0000 (13:58 +0000)
As suggested by Ruediger, let the HTTP_IN filter handle the 100 continue from
spool_reqbody_cl().

Also, according to rfc7231#section-5.1.1, we don't need the interim response
if we "already received some or all of the message body", which is now also
taken into account.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868625 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index 152da0143361b3f5ddb361574e516a4be6f28838..1f72688f2e2fceb0ae057b13e1d7faa38fd178b7 100644 (file)
@@ -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;
 
-    /* Send "100 Continue" now if the client expects one, before
-     * blocking on the body, otherwise we'd wait for each other.
+    /*
+     * 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.
      */
     if (req->expecting_100) {
-        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;
+        /* 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);
         req->expecting_100 = 0;
     }