diff options
author | Yann Ylavic <ylavic@apache.org> | 2020-05-29 19:05:29 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2020-05-29 19:05:29 +0200 |
commit | 53e2b681365306df932ec1b4ded187dab8e99c10 (patch) | |
tree | 36d3cd7fe39afaf1818f5927c0a1c87977d3c2ac /modules/proxy/mod_proxy_http.c | |
parent | revert r1878268 (diff) | |
download | apache2-53e2b681365306df932ec1b4ded187dab8e99c10.tar.xz apache2-53e2b681365306df932ec1b4ded187dab8e99c10.zip |
mod_proxy_http: don't strip EOS when spooling request body to file.
To prevent stream_reqbody() from sending the FILE and EOS bucket in separate
brigades, and thus apr_file_setaside() to trigger if network congestion occurs
with the backend, restore the EOS in spool_reqbody_cl() which was stripped
when spooling the request body to a file.
Until APR r1878279 is released (and installed by users), apr_file_setaside()
on a temporary file (mktemp) will simply drop the file cleanup, leaking the
fd and inode..
This fixes BZ 64452.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878280 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/mod_proxy_http.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index f2857439d2..a4be4ee336 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -549,6 +549,14 @@ static int spool_reqbody_cl(proxy_http_req_t *req, apr_off_t *bytes_spooled) e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(input_brigade, e); } + if (tmpfile) { + /* We dropped metadata buckets when spooling to tmpfile, + * terminate with EOS for stream_reqbody() to flush the + * whole in one go. + */ + e = apr_bucket_eos_create(bucket_alloc); + APR_BRIGADE_INSERT_TAIL(input_brigade, e); + } return OK; } |