# HG changeset patch # User Igor Sysoev # Date 1242663589 0 # Node ID 7a10334d4bce141b85560389dda434d9edde9bad # Parent 1804da35f85310021ca1e3e337a3a8431108d4fa r2821 merge: test already destroyed request diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1557,16 +1557,24 @@ ngx_http_send_header(ngx_http_request_t ngx_int_t ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in) { - ngx_int_t rc; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + ngx_int_t rc; + ngx_connection_t *c; + + c = r->connection; + + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "http output filter \"%V?%V\"", &r->uri, &r->args); rc = ngx_http_top_body_filter(r, in); if (rc == NGX_ERROR) { + + if (c->destroyed) { + return NGX_DONE; + } + /* NGX_ERROR may be returned by any filter */ - r->connection->error = 1; + c->error = 1; } return rc;