From d3283ff9224a41a1a24c2d89f671811c0747480a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 5 Dec 2005 13:18:09 +0000 Subject: nginx-0.3.13-RELEASE import *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; the bug had appeared in 0.3.11. --- src/event/ngx_event_pipe.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/event/ngx_event_pipe.c') diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c index 779ec1867..0c499a831 100644 --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -407,12 +407,15 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p) static ngx_int_t ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) { - size_t bsize; - ngx_uint_t flush; - ngx_chain_t *out, **ll, *cl; + size_t bsize; + ngx_uint_t flush; + ngx_chain_t *out, **ll, *cl; + ngx_connection_t *downstream; + + downstream = p->downstream; ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, - "pipe write downstream: %d", p->downstream->write->ready); + "pipe write downstream: %d", downstream->write->ready); for ( ;; ) { if (p->downstream_error) { @@ -452,6 +455,11 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) } if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) { + + if (downstream->destroyed) { + return NGX_ABORT; + } + p->downstream_error = 1; return ngx_event_pipe_drain_chains(p); } @@ -468,9 +476,9 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) break; } - if (p->downstream->data != p->output_ctx - || !p->downstream->write->ready - || p->downstream->write->delayed) + if (downstream->data != p->output_ctx + || !downstream->write->ready + || downstream->write->delayed) { break; } -- cgit