diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2002-07-17 21:18:39 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2002-07-17 21:18:39 +0200 |
commit | 347341d9ebfacb088c0780dd8725930688544e32 (patch) | |
tree | 226a815749ad8503f1a0bc0479449310da536f44 | |
parent | Add some debugging logic to perchild. This is almost working now, we just (diff) | |
download | apache2-347341d9ebfacb088c0780dd8725930688544e32.tar.xz apache2-347341d9ebfacb088c0780dd8725930688544e32.zip |
Solve C-L post body reads from the HTTP_IN by ap_get_brigade() so that
we know -immediately- that we've read the last of the data. This patch
adds an EOS bucket to the brigade if ctx->remaining has been consumed.
Reviewed by: Justin Erenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96104 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | modules/http/http_protocol.c | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -1,5 +1,10 @@ Changes with Apache 2.0.40 + *) Modified the HTTP_IN filter to immediately append the EOS (end of + stream) bucket for C-L POST bodies, saving a roundtrip and allowing + the caller to determine that no content remains without prefetching + additional POST body. [William Rowe] + *) Get proxy ftp to work over IPv6. [Shoichi Sakane <sakane@kame.net>] *) Look for OpenSSL libraries in /usr/lib64. [Peter Poeml <poeml@suse.de>] diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 58aa416590..c34df22407 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1025,6 +1025,14 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ctx->remaining -= totalread; } + /* If we have no more bytes remaining on a C-L request, + * save the callter a roundtrip to discover EOS. + */ + if (ctx->state == BODY_LENGTH && ctx->remaining == 0) { + e = apr_bucket_eos_create(f->c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } + /* We have a limit in effect. */ if (ctx->limit) { /* FIXME: Note that we might get slightly confused on chunked inputs |