# HG changeset patch # User Igor Sysoev # Date 1251303297 0 # Node ID f54b02dbb12bbc33274e9cb38b9394064740b52f # Parent 67254117b774e93c0aa0c66177d5e6baa7a340b6 axe r->connection->destroyed testing diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -454,10 +454,6 @@ ngx_event_pipe_write_to_downstream(ngx_e rc = p->output_filter(p->output_ctx, p->out); - if (downstream->destroyed) { - return NGX_ABORT; - } - if (rc == NGX_ERROR) { p->downstream_error = 1; return ngx_event_pipe_drain_chains(p); @@ -476,10 +472,6 @@ ngx_event_pipe_write_to_downstream(ngx_e rc = p->output_filter(p->output_ctx, p->in); - if (downstream->destroyed) { - return NGX_ABORT; - } - if (rc == NGX_ERROR) { p->downstream_error = 1; return ngx_event_pipe_drain_chains(p); @@ -624,10 +616,6 @@ ngx_event_pipe_write_to_downstream(ngx_e rc = p->output_filter(p->output_ctx, out); - if (downstream->destroyed) { - return NGX_ABORT; - } - if (rc == NGX_ERROR) { p->downstream_error = 1; return ngx_event_pipe_drain_chains(p); diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -686,15 +686,6 @@ ngx_http_perl_call_handler(pTHX_ ngx_htt SPAGAIN; - if (c->destroyed) { - PUTBACK; - - FREETMPS; - LEAVE; - - return NGX_DONE; - } - if (n) { if (rv == NULL) { status = POPi; diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c --- a/src/http/ngx_http_copy_filter_module.c +++ b/src/http/ngx_http_copy_filter_module.c @@ -109,17 +109,15 @@ ngx_http_copy_filter(ngx_http_request_t rc = ngx_output_chain(ctx, in); - if (!c->destroyed) { + if (ctx->in == NULL) { + r->buffered &= ~NGX_HTTP_COPY_BUFFERED; - if (ctx->in == NULL) { - r->buffered &= ~NGX_HTTP_COPY_BUFFERED; - } else { - r->buffered |= NGX_HTTP_COPY_BUFFERED; - } + } else { + r->buffered |= NGX_HTTP_COPY_BUFFERED; + } - ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args); - } + ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args); return rc; } 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 @@ -1685,11 +1685,6 @@ ngx_http_output_filter(ngx_http_request_ 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 */ c->error = 1; } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2004,10 +2004,6 @@ ngx_http_finalize_request(ngx_http_reque ngx_del_timer(c->write); } - if (c->destroyed) { - return; - } - if (c->read->eof) { ngx_http_close_request(r, 0); return; @@ -2179,10 +2175,6 @@ ngx_http_writer(ngx_http_request_t *r) rc = ngx_http_output_filter(r, NULL); - if (c->destroyed) { - return; - } - ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0, "http writer output filter: %d, \"%V?%V\"", rc, &r->uri, &r->args); diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2260,10 +2260,6 @@ ngx_http_upstream_process_non_buffered_r if (u->out_bufs || u->busy_bufs) { rc = ngx_http_output_filter(r, u->out_bufs); - if (downstream->destroyed) { - return; - } - if (rc == NGX_ERROR) { ngx_http_upstream_finalize_request(r, u, 0); return; @@ -2436,11 +2432,6 @@ ngx_http_upstream_process_downstream(ngx } if (ngx_event_pipe(p, wev->write) == NGX_ABORT) { - - if (c->destroyed) { - return; - } - ngx_http_upstream_finalize_request(r, u, 0); return; } @@ -2466,11 +2457,6 @@ ngx_http_upstream_process_downstream(ngx } if (ngx_event_pipe(p, 1) == NGX_ABORT) { - - if (c->destroyed) { - return; - } - ngx_http_upstream_finalize_request(r, u, 0); return; } @@ -2498,14 +2484,7 @@ ngx_http_upstream_process_upstream(ngx_h ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); } else { - c = r->connection; - if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) { - - if (c->destroyed) { - return; - } - ngx_http_upstream_finalize_request(r, u, 0); return; }