]> granicus.if.org Git - apache/commitdiff
Remove REQUEST_CHUNKED_PASS and change ap_discard_request_body()
authorSascha Schumann <sascha@apache.org>
Fri, 3 Nov 2000 17:34:59 +0000 (17:34 +0000)
committerSascha Schumann <sascha@apache.org>
Fri, 3 Nov 2000 17:34:59 +0000 (17:34 +0000)
to use REQUEST_CHUNKED_DECHUNK.

Because of this change, the need for handle_request_body() is gone,
so we remove that as well.

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

include/http_protocol.h
include/httpd.h
modules/http/http_core.c
modules/http/http_protocol.c

index fe2c9a4ac02a94a64b8873282e51387eecb202f5..953ab92bdd335b32b461a8d415b35433c3fb1cbf 100644 (file)
@@ -388,7 +388,6 @@ AP_DECLARE(const char *) ap_get_status_line(int status);
  *    REQUEST_NO_BODY          Send 413 error if message has any body
  *    REQUEST_CHUNKED_ERROR    Send 411 error if body without Content-Length
  *    REQUEST_CHUNKED_DECHUNK  If chunked, remove the chunks for me.
- *    REQUEST_CHUNKED_PASS     Pass the chunks to me without removal.
  * </PRE>
  * @return either OK or an error code
  * @deffunc int ap_setup_cleint_block(request_rec *r, int read_policy)
index 39682d72c1d0fe32cca99028c75c5a56564e35b7..12b62b63e36a38fbff5054d5e7ad828e0f867666 100644 (file)
@@ -540,12 +540,10 @@ struct ap_method_list_t {
  *    REQUEST_NO_BODY          Send 413 error if message has any body
  *    REQUEST_CHUNKED_ERROR    Send 411 error if body without Content-Length
  *    REQUEST_CHUNKED_DECHUNK  If chunked, remove the chunks for me.
- *    REQUEST_CHUNKED_PASS     Pass the chunks to me without removal.
  */
 #define REQUEST_NO_BODY          0
 #define REQUEST_CHUNKED_ERROR    1
 #define REQUEST_CHUNKED_DECHUNK  2
-#define REQUEST_CHUNKED_PASS     3
 
 /* Things which may vary per file-lookup WITHIN a request ---
  * e.g., state of MIME config.  Basically, the name of an object, info
index 2f9c985afae5a55d09700e3c94f64d4844c90e9d..6bbaa86257346a1a6dbab4c68c207ba9123a9bcc 100644 (file)
@@ -2908,25 +2908,6 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r)
 
 static int do_nothing(request_rec *r) { return OK; }
 
-#define POST_CHUNK_SIZE 4096
-
-static int handle_request_body(request_rec *r)
-{
-    int rv;
-    char buf[POST_CHUNK_SIZE];
-    long n;
-
-    if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)))
-        return rv;
-
-    if ((rv = ap_should_client_block(r)) == 0)
-        return APR_SUCCESS;
-
-    while ((n = ap_get_client_block(r, buf, POST_CHUNK_SIZE)) > 0);
-
-    return APR_SUCCESS;
-}
-
 static int default_handler(request_rec *r)
 {
     core_dir_config *d =
@@ -2949,11 +2930,7 @@ static int default_handler(request_rec *r)
 
     ap_allow_methods(r, MERGE_ALLOW, "GET", "OPTIONS", "POST", NULL);
 
-    if (r->method_number == M_POST) {
-        if ((errstatus = handle_request_body(r)) != APR_SUCCESS) {
-            return errstatus;
-        }
-    } else if ((errstatus = ap_discard_request_body(r)) != OK) {
+    if ((errstatus = ap_discard_request_body(r)) != OK) {
         return errstatus;
     }
     
index a3aa5db38fe1f5b8e398d8eec30bf54ca94f7911..e987bd2c6394758f3236d34de91c8a42cac86637 100644 (file)
@@ -816,7 +816,6 @@ struct dechunk_ctx {
     apr_ssize_t chunk_size;
     apr_ssize_t bytes_delivered;
     enum {WANT_HDR /* must have value zero */, WANT_BODY, WANT_TRL} state;
-    int remove_chunk_proto;
 };
 
 static long get_chunk_size(char *);
@@ -833,7 +832,6 @@ apr_status_t ap_dechunk_filter(ap_filter_t *f, ap_bucket_brigade *bb,
 
     if (!ctx) {
         f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(struct dechunk_ctx));
-        ctx->remove_chunk_proto = f->r->read_body != REQUEST_CHUNKED_PASS;
     }
 
     do {
@@ -2487,7 +2485,6 @@ AP_DECLARE(void) ap_finalize_request_protocol(request_rec *r)
  *    REQUEST_NO_BODY          Send 413 error if message has any body
  *    REQUEST_CHUNKED_ERROR    Send 411 error if body without Content-Length
  *    REQUEST_CHUNKED_DECHUNK  If chunked, remove the chunks for me.
- *    REQUEST_CHUNKED_PASS     Pass the chunks to me without removal.
  *
  *    In order to use the last two options, the caller MUST provide a buffer
  *    large enough to hold a chunk-size line, including any extensions.
@@ -2530,10 +2527,6 @@ AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy)
         }
 
         r->read_chunked = 1;
-        if (r->read_body == REQUEST_CHUNKED_PASS) {
-            /* can't filter the body *and* preserve the chunk headers */
-            r->input_filters = r->connection->input_filters;
-        }
         ap_add_input_filter("DECHUNK", NULL, r, r->connection);
     }
     else if (lenp) {
@@ -2718,7 +2711,7 @@ AP_DECLARE(int) ap_discard_request_body(request_rec *r)
 {
     int rv;
 
-    if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_PASS)))
+    if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)))
         return rv;
 
     /* In order to avoid sending 100 Continue when we already know the