Mercurial > hg > nginx
comparison src/event/ngx_event_pipe.c @ 6672:0fa883e92895
Event pipe: process data after recv_chain() errors.
When c->recv_chain() returns an error, it is possible that we already
have some data previously read, e.g., in preread buffer. And in some
cases it may be even a complete response. Changed c->recv_chain() error
handling to process the data, much like it is already done if kevent
reports about an error.
This change, in particular, fixes processing of small responses
when an upstream fails to properly close a connection with lingering and
therefore the connection is reset, but the response is already fully
obtained by nginx (see ticket #1037).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 01 Sep 2016 18:29:55 +0300 |
parents | f01ab2dbcfdc |
children | e4c1f5b32868 |
comparison
equal
deleted
inserted
replaced
6671:6b1b8c4b7a95 | 6672:0fa883e92895 |
---|---|
298 } | 298 } |
299 p->free_raw_bufs = chain; | 299 p->free_raw_bufs = chain; |
300 | 300 |
301 if (n == NGX_ERROR) { | 301 if (n == NGX_ERROR) { |
302 p->upstream_error = 1; | 302 p->upstream_error = 1; |
303 return NGX_ERROR; | 303 break; |
304 } | 304 } |
305 | 305 |
306 if (n == NGX_AGAIN) { | 306 if (n == NGX_AGAIN) { |
307 if (p->single_buf) { | 307 if (p->single_buf) { |
308 ngx_event_pipe_remove_shadow_links(chain->buf); | 308 ngx_event_pipe_remove_shadow_links(chain->buf); |