From 93628c19b1462150ee6d199c3597f2d5ebe703cc Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 17 Jul 2002 19:18:39 +0000 Subject: [PATCH] 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 --- CHANGES | 5 +++++ modules/http/http_protocol.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGES b/CHANGES index 661ce4252d..dcdb1ecad9 100644 --- a/CHANGES +++ b/CHANGES @@ -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 ] *) Look for OpenSSL libraries in /usr/lib64. [Peter Poeml ] 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 -- 2.40.0