]> git.kaiwu.me - nginx.git/commitdiff
axe r->connection->destroyed testing
authorIgor Sysoev <igor@sysoev.ru>
Wed, 26 Aug 2009 16:14:57 +0000 (16:14 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 26 Aug 2009 16:14:57 +0000 (16:14 +0000)
src/event/ngx_event_pipe.c
src/http/modules/perl/ngx_http_perl_module.c
src/http/ngx_http_copy_filter_module.c
src/http/ngx_http_core_module.c
src/http/ngx_http_request.c
src/http/ngx_http_upstream.c

index 5d5035ce2615d587fad6a0149a619fc06eef571c..bc9fb26ab51699091397fd0abb1d6b2427e6635b 100644 (file)
@@ -454,10 +454,6 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
 
                 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_event_pipe_t *p)
 
                 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_event_pipe_t *p)
 
         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);
index 4409e8fa725f93b3b77ab00ac6bcd04f06c815b1..c4f52a58f716bfcfc88528ac33e7d57c9a2a76d7 100644 (file)
@@ -686,15 +686,6 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, HV *nginx, SV *sub,
 
     SPAGAIN;
 
-    if (c->destroyed) {
-        PUTBACK;
-
-        FREETMPS;
-        LEAVE;
-
-        return NGX_DONE;
-    }
-
     if (n) {
         if (rv == NULL) {
             status = POPi;
index c7f6be29d6a7eb9cccc399bec7851101f3ec20d3..688677f50a063e1367cd4fdb2409348d771bd4f0 100644 (file)
@@ -109,18 +109,16 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
 
     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;
-        }
-
-        ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-                       "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
+    } 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);
+
     return rc;
 }
 
index 988d8f0e827e1339ff612303c2b3d7de91067d13..7b47fbb61a9005df315a9e984549dd1f739ff90b 100644 (file)
@@ -1685,11 +1685,6 @@ ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
     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;
     }
index f071cf5232b90724b9cb2df0fec8c2db16d1cdd4..07bd563020fbe7f045a47dcc00fed02dbb85c56c 100644 (file)
@@ -2004,10 +2004,6 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
         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);
index 404be48ef8442a0ea15fbdac3c0461a78710a458..f552d2e7619780cacf1114678fc31459af12f217 100644 (file)
@@ -2260,10 +2260,6 @@ ngx_http_upstream_process_non_buffered_request(ngx_http_request_t *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_http_request_t *r)
             }
 
             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_http_request_t *r)
         }
 
         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_http_request_t *r,
         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;
         }