Klaus Demo nginx / f9e43a3
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). Maxim Dounin 3 years ago
1 changed file(s) with 13 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
20122012
20132013 /* rc == NGX_OK */
20142014
2015 u->request_body_sent = 1;
2016
20172015 if (c->write->timer_set) {
20182016 ngx_del_timer(c->write);
20192017 }
20402038 return;
20412039 }
20422040
2043 ngx_add_timer(c->read, u->conf->read_timeout);
2044
2045 if (c->read->ready) {
2046 ngx_http_upstream_process_header(r, u);
2047 return;
2041 if (!u->request_body_sent) {
2042 u->request_body_sent = 1;
2043
2044 if (u->header_sent) {
2045 return;
2046 }
2047
2048 ngx_add_timer(c->read, u->conf->read_timeout);
2049
2050 if (c->read->ready) {
2051 ngx_http_upstream_process_header(r, u);
2052 return;
2053 }
20482054 }
20492055 }
20502056