Changeset 7260:08f114ed5449 in nginx


Ignore:
Timestamp:
04/05/18 13:56:12 (2 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Message:

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/ngx_http_upstream.c

    r7255 r7260  
    20142014    /* rc == NGX_OK */
    20152015
    2016     u->request_body_sent = 1;
    2017 
    20182016    if (c->write->timer_set) {
    20192017        ngx_del_timer(c->write);
     
    20422040    }
    20432041
    2044     ngx_add_timer(c->read, u->conf->read_timeout);
    2045 
    2046     if (c->read->ready) {
    2047         ngx_http_upstream_process_header(r, u);
    2048         return;
     2042    if (!u->request_body_sent) {
     2043        u->request_body_sent = 1;
     2044
     2045        if (u->header_sent) {
     2046            return;
     2047        }
     2048
     2049        ngx_add_timer(c->read, u->conf->read_timeout);
     2050
     2051        if (c->read->ready) {
     2052            ngx_http_upstream_process_header(r, u);
     2053            return;
     2054        }
    20492055    }
    20502056}
Note: See TracChangeset for help on using the changeset viewer.