Request body: all read data are now sent to filters.

This is a prerequisite for the next change to allow large reads
on chunk boundaries.
This commit is contained in:
Maxim Dounin 2020-08-06 05:02:44 +03:00
parent bd7dad5b0e
commit 9edc93fe0e

View File

@ -282,21 +282,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
for ( ;; ) {
if (rb->buf->last == rb->buf->end) {
if (rb->buf->pos != rb->buf->last) {
/* pass buffer to request body filter chain */
out.buf = rb->buf;
out.next = NULL;
rc = ngx_http_request_body_filter(r, &out);
if (rc != NGX_OK) {
return rc;
}
} else {
/* update chains */
rc = ngx_http_request_body_filter(r, NULL);
@ -304,7 +289,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
if (rc != NGX_OK) {
return rc;
}
}
if (rb->busy != NULL) {
if (r->request_body_no_buffering) {
@ -355,7 +339,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
rb->buf->last += n;
r->request_length += n;
if (n == rest) {
/* pass buffer to request body filter chain */
out.buf = rb->buf;
@ -366,7 +349,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
if (rc != NGX_OK) {
return rc;
}
}
if (rb->rest == 0) {
break;
@ -386,21 +368,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
if (!c->read->ready) {
if (r->request_body_no_buffering
&& rb->buf->pos != rb->buf->last)
{
/* pass buffer to request body filter chain */
out.buf = rb->buf;
out.next = NULL;
rc = ngx_http_request_body_filter(r, &out);
if (rc != NGX_OK) {
return rc;
}
}
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
ngx_add_timer(c->read, clcf->client_body_timeout);