diff options
| author | Sergey Kandaurov <pluknet@nginx.com> | 2021-03-30 23:34:51 +0300 |
|---|---|---|
| committer | Sergey Kandaurov <pluknet@nginx.com> | 2021-03-30 23:34:51 +0300 |
| commit | dd98809befadeda443a0e25da70c3020e613481e (patch) | |
| tree | 9a21777e29904ad66ddb5b852d55036aff15476b /src/http/ngx_http_upstream.c | |
| parent | 7d1cf8ffb442727bc8e54630dd565c8139cead67 (diff) | |
| parent | 7b053dd1b20237622f89148e6c01a43927a4572a (diff) | |
| download | nginx-dd98809befadeda443a0e25da70c3020e613481e.tar.gz nginx-dd98809befadeda443a0e25da70c3020e613481e.tar.bz2 | |
Merged with the default branch.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
| -rw-r--r-- | src/http/ngx_http_upstream.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index ca860eb56..d0a6d3537 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -614,6 +614,17 @@ ngx_http_upstream_init_request(ngx_http_request_t *r) u->store = u->conf->store; if (!u->store && !r->post_action && !u->conf->ignore_client_abort) { + + if (r->connection->read->ready) { + ngx_post_event(r->connection->read, &ngx_posted_events); + + } else { + if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) { + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + return; + } + } + r->read_event_handler = ngx_http_upstream_rd_check_broken_connection; r->write_event_handler = ngx_http_upstream_wr_check_broken_connection; } @@ -3031,9 +3042,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u) return; } - if (u->peer.connection->read->ready || u->length == 0) { - ngx_http_upstream_process_non_buffered_upstream(r, u); - } + ngx_http_upstream_process_non_buffered_upstream(r, u); } return; |
