mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -06:00
Upstream: fixed u->conf->preserve_output (ticket #1519).
Previously, ngx_http_upstream_process_header() might be called after we've finished reading response headers and switched to a different read event handler, leading to errors with gRPC proxying. Additionally, the u->conf->read_timeout timer might be re-armed during reading response headers (while this is expected to be a single timeout on reading the whole response header).
This commit is contained in:
parent
923c9d5f3b
commit
f9e43a3154
@ -2013,8 +2013,6 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||||||
|
|
||||||
/* rc == NGX_OK */
|
/* rc == NGX_OK */
|
||||||
|
|
||||||
u->request_body_sent = 1;
|
|
||||||
|
|
||||||
if (c->write->timer_set) {
|
if (c->write->timer_set) {
|
||||||
ngx_del_timer(c->write);
|
ngx_del_timer(c->write);
|
||||||
}
|
}
|
||||||
@ -2041,6 +2039,13 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!u->request_body_sent) {
|
||||||
|
u->request_body_sent = 1;
|
||||||
|
|
||||||
|
if (u->header_sent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_add_timer(c->read, u->conf->read_timeout);
|
ngx_add_timer(c->read, u->conf->read_timeout);
|
||||||
|
|
||||||
if (c->read->ready) {
|
if (c->read->ready) {
|
||||||
@ -2048,6 +2053,7 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static ngx_int_t
|
static ngx_int_t
|
||||||
|
Loading…
Reference in New Issue
Block a user