aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request_body.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_request_body.c')
-rw-r--r--src/http/ngx_http_request_body.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 66c7c6722..6f02f0d4b 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -220,14 +220,7 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
"http client request body recv %z", n);
if (n == NGX_AGAIN) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- ngx_add_timer(c->read, clcf->client_body_timeout);
-
- if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- return NGX_AGAIN;
+ break;
}
if (n == 0) {
@@ -257,9 +250,20 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
"http client request body rest %uz", rb->rest);
if (rb->rest) {
+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+ ngx_add_timer(c->read, clcf->client_body_timeout);
+
+ if (ngx_handle_read_event(c->read, 0) == NGX_ERROR) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
return NGX_AGAIN;
}
+ if (c->read->timer_set) {
+ ngx_del_timer(c->read);
+ }
+
if (rb->temp_file) {
/* save the last part */