mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +08:00
fix ngx_http_finalize_request() code after a body has been discarded
This commit is contained in:
parent
11e5d7f190
commit
7060e670f4
@ -503,7 +503,7 @@ ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r)
|
|||||||
if (rev->timedout) {
|
if (rev->timedout) {
|
||||||
c->timedout = 1;
|
c->timedout = 1;
|
||||||
c->error = 1;
|
c->error = 1;
|
||||||
ngx_http_finalize_request(r, 0);
|
ngx_http_finalize_request(r, NGX_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r)
|
|||||||
if (timer <= 0) {
|
if (timer <= 0) {
|
||||||
r->discard_body = 0;
|
r->discard_body = 0;
|
||||||
r->lingering_close = 0;
|
r->lingering_close = 0;
|
||||||
ngx_http_finalize_request(r, 0);
|
ngx_http_finalize_request(r, NGX_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,14 +524,9 @@ ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r)
|
|||||||
rc = ngx_http_read_discarded_request_body(r);
|
rc = ngx_http_read_discarded_request_body(r);
|
||||||
|
|
||||||
if (rc == NGX_OK) {
|
if (rc == NGX_OK) {
|
||||||
|
|
||||||
r->discard_body = 0;
|
r->discard_body = 0;
|
||||||
r->lingering_close = 0;
|
r->lingering_close = 0;
|
||||||
|
ngx_http_finalize_request(r, NGX_DONE);
|
||||||
if (r->done) {
|
|
||||||
ngx_http_finalize_request(r, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +534,7 @@ ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r)
|
|||||||
|
|
||||||
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
|
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
|
||||||
c->error = 1;
|
c->error = 1;
|
||||||
ngx_http_finalize_request(r, rc);
|
ngx_http_finalize_request(r, NGX_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user