summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http_request.c2
-rw-r--r--src/http/ngx_http_request_body.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index d11b13e4a..5e0b8e891 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2123,11 +2123,11 @@ ngx_http_finalize_connection(ngx_http_request_t *r)
if (r->discard_body) {
r->read_event_handler = ngx_http_discarded_request_body_handler;
+ ngx_add_timer(r->connection->read, clcf->lingering_timeout);
if (r->lingering_time == 0) {
r->lingering_time = ngx_time()
+ (time_t) (clcf->lingering_time / 1000);
- ngx_add_timer(r->connection->read, clcf->lingering_timeout);
}
}
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index be311a612..817b48e45 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -143,6 +143,7 @@ ngx_http_read_client_request_body(ngx_http_request_t *r,
r->header_in->pos += (size_t) r->headers_in.content_length_n;
r->request_length += r->headers_in.content_length_n;
+ b->last = r->header_in->pos;
if (r->request_body_in_file_only) {
if (ngx_http_write_request_body(r, rb->bufs) != NGX_OK) {
@@ -371,10 +372,14 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
}
}
- if (r->request_body_in_file_only && rb->bufs->next) {
+ if (rb->bufs->next
+ && (r->request_body_in_file_only || r->request_body_in_single_buf))
+ {
rb->bufs = rb->bufs->next;
}
+ r->read_event_handler = ngx_http_block_reading;
+
rb->post_handler(r);
return NGX_OK;