]> granicus.if.org Git - apache/commitdiff
As discussed previously on-list, HTTP_IN should return EOS if it thinks
authorJustin Erenkrantz <jerenkrantz@apache.org>
Wed, 29 May 2002 23:04:14 +0000 (23:04 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Wed, 29 May 2002 23:04:14 +0000 (23:04 +0000)
there is no request body.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95370 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index fd09abc39eba0af98645b2b43e8b7c750dd6ee1e..35037cc98efb379f822e83975b5dd5e9a5fa0060 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.37
 
+  *) Allow ap_http_filter (HTTP_IN) to return EOS when there is no request
+     body.  [Justin Erenkrantz]
+    
   *) NetWare: Piping log entries through RotateLogs using the 
      CustomLogs directive is finally supported now that we have 
         the pipes and spawning functionality working.
index d7c5816ae2bdc8cc7f37e5852b45adf3a5b83ea5..3939594eef87f5449beaec28689731b198bfd258 100644 (file)
@@ -822,6 +822,20 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
             }
         }
 
+        /* If we don't have a request entity indicated by the headers, EOS.
+         * (BODY_NONE is a valid intermediate state due to trailers,
+         *  but it isn't a valid starting state.)
+         *
+         * RFC 2616 Section 4.4 note 5 states that connection-close
+         * is invalid for a request entity - request bodies must be
+         * denoted by C-L or T-E: chunked.
+         */
+        if (ctx->state == BODY_NONE) {
+            e = apr_bucket_eos_create(f->r->connection->bucket_alloc);
+            APR_BRIGADE_INSERT_TAIL(b, e);
+            return APR_SUCCESS;
+        }
+
         /* Since we're about to read data, send 100-Continue if needed.
          * Only valid on chunked and C-L bodies where the C-L is > 0. */
         if ((ctx->state == BODY_CHUNK ||