diff options
author | Yann Ylavic <ylavic@apache.org> | 2019-02-11 22:55:43 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2019-02-11 22:55:43 +0100 |
commit | 01d8e196dc76a33d75cdd31fcb9c203397245112 (patch) | |
tree | 36da566ebf2cecd212221102bb0c55dcb4d8a195 /modules/http2/mod_proxy_http2.c | |
parent | Follow up to r1847430. (diff) | |
download | apache2-01d8e196dc76a33d75cdd31fcb9c203397245112.tar.xz apache2-01d8e196dc76a33d75cdd31fcb9c203397245112.zip |
mod_proxy_http: rework the flushing strategy when forwarding the request body.
Since the forwarding of 100-continue (end to end) in r1836588, we depended on
reading all of the requested HUGE_STRING_LEN bytes to avoid the flushes, but
this is a bit fragile.
This commit introduces the new stream_reqbody_read() function which will try a
nonblocking read first and, if it fails with EAGAIN, will flush on the backend
side before blocking for the next client side read.
We can then use it in stream_reqbody_{chunked,cl}() to flush client forwarded
data only when necessary. This both allows "optimal" flushing and simplifies
code (note that spool_reqbody_cl() also makes use of the new function but not
its nonblocking/flush functionality, thus only for consistency with the two
others, simplification and common error handling).
Also, since proxy_http_req_t::flushall/subprocess_env::proxy-flushall are now
meaningless (and unused) on the backend side, they are renamed respectively to
prefetch_nonblocking/proxy-prefetch-nonblocking, and solely determine whether
to prefetch in nonblocking mode or not. These flags were trunk only and may
not be really useful if we decided to prefetch in nonblocking mode in any case,
but for 2.4.x the opt-in looks wise.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853407 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2/mod_proxy_http2.c')
-rw-r--r-- | modules/http2/mod_proxy_http2.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/modules/http2/mod_proxy_http2.c b/modules/http2/mod_proxy_http2.c index 4ac9325118..a585706aaf 100644 --- a/modules/http2/mod_proxy_http2.c +++ b/modules/http2/mod_proxy_http2.c @@ -77,7 +77,6 @@ typedef struct h2_proxy_ctx { unsigned standalone : 1; unsigned is_ssl : 1; - unsigned flushall : 1; apr_status_t r_status; /* status of our first request work */ h2_proxy_session *session; /* current http2 session against backend */ @@ -509,7 +508,6 @@ static int proxy_http2_handler(request_rec *r, ctx->is_ssl = is_ssl; ctx->worker = worker; ctx->conf = conf; - ctx->flushall = apr_table_get(r->subprocess_env, "proxy-flushall")? 1 : 0; ctx->r_status = HTTP_SERVICE_UNAVAILABLE; h2_proxy_fifo_set_create(&ctx->requests, ctx->pool, 100); |