]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
Make HTTP_IN filter send 100 continue in blocking mode only.
authorYann Ylavic <ylavic@apache.org>
Thu, 19 Nov 2020 12:12:04 +0000 (12:12 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 19 Nov 2020 12:12:04 +0000 (12:12 +0000)
commit7c220fc6752790cadf57c23653e09685af08a7e5
tree76bb8e6edaf583abd49d28b8281a9024c8f77d04
parent7fb5cc1c7338ef8f4d4b3b96126dfe67bd4e67b1
Make HTTP_IN filter send 100 continue in blocking mode only.

When mod_proxy_http prefetches input data it calls the HTTP_IN filter
in nonblocking mode, but since it does not want 100 continue to be sent
for every case (e.g. 100-continue forwarding), it hacks r->expecting_100
(save in req->expecting_100, reset, eventually restore..) all over the
place.

Let's avoid this by making the HTTP_IN filter send 100 continue only
when called in blocking mode (once still), instead of the first time
it's called.

* modules/http/http_filters.c (struct http_filter_ctx): Add the seen_data
  bit and rename eos_sent to at_eos (HTTP_IN does not send any EOS).

* modules/http/http_filters.c (ap_http_filter): Move 100 continue
  handling outside the initialization/once block, and do it in blocking
  mode only. Track in ctx->seen_data whether some data were already
  received, and if so don't send 100 continue per RFC 7231 5.1.1.

* modules/proxy/mod_proxy_http.c: Remove req->expecting_100 (and its
  danse with r->expecting_100) now that reading from the input filters
  does the right thing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883639 13f79535-47bb-0310-9956-ffa450edef68
modules/http/http_filters.c
modules/proxy/mod_proxy_http.c