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
* 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)
* 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
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 =
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;
}
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 *);
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 {
* 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.
}
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) {
{
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