From 45ac93cdb465cf6504d39cb7b5102a04c9634480 Mon Sep 17 00:00:00 2001 From: Hakase Date: Fri, 6 Apr 2018 04:39:29 +0900 Subject: [PATCH] Latest update - 7260 --- src/http/ngx_http_upstream.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index f5eda7f..f48f497 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2024,8 +2024,6 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u, /* rc == NGX_OK */ - u->request_body_sent = 1; - if (c->write->timer_set) { ngx_del_timer(c->write); } @@ -2052,11 +2050,19 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u, return; } - ngx_add_timer(c->read, u->conf->read_timeout); + if (!u->request_body_sent) { + u->request_body_sent = 1; - if (c->read->ready) { - ngx_http_upstream_process_header(r, u); - return; + if (u->header_sent) { + return; + } + + ngx_add_timer(c->read, u->conf->read_timeout); + + if (c->read->ready) { + ngx_http_upstream_process_header(r, u); + return; + } } }