]> granicus.if.org Git - apache/commitdiff
Solve C-L post body reads from the HTTP_IN by ap_get_brigade() so that
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 17 Jul 2002 19:18:39 +0000 (19:18 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 17 Jul 2002 19:18:39 +0000 (19:18 +0000)
  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
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index 661ce4252d616fabf2fee529f80530691b1c8bee..dcdb1ecad96b552450847e35819196ab0457a701 100644 (file)
--- 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 <sakane@kame.net>]
 
   *) Look for OpenSSL libraries in /usr/lib64.  [Peter Poeml <poeml@suse.de>]
index 58aa4165907f9861283f89f5ba144f3e9a6b96e7..c34df2240746f3ba52af9774af9291d1f36b495f 100644 (file)
@@ -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