]> granicus.if.org Git - apache/commitdiff
core_output_filter: back out changes to clean up resources before the end
authorGreg Ames <gregames@apache.org>
Sat, 16 Nov 2002 02:27:33 +0000 (02:27 +0000)
committerGreg Ames <gregames@apache.org>
Sat, 16 Nov 2002 02:27:33 +0000 (02:27 +0000)
of a keepalive connection until we can figure out how to do it safely for
mmap buckets

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97539 13f79535-47bb-0310-9956-ffa450edef68

server/core.c

index ed04d5c78580f5df1a83f07915b251a5fc1df28c..ceb5627f17ef9703c39412addb1d2d516d4e655c 100644 (file)
@@ -3665,12 +3665,11 @@ static APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
 static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
 {
     apr_status_t rv;
-    apr_bucket_brigade *more;  /* definition moved to foil a gdb bug */
+    apr_bucket_brigade *more;
     conn_rec *c = f->c;
     core_net_rec *net = f->ctx;
     core_output_filter_ctx_t *ctx = net->out_ctx;
     apr_read_type_e eblock = APR_NONBLOCK_READ;
-    apr_pool_t *input_pool = b->p;
 
     if (ctx == NULL) {
         ctx = apr_pcalloc(c->pool, sizeof(*ctx));
@@ -3925,10 +3924,7 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
                     }
                 }
             }
-            if (!ctx->deferred_write_pool) {
-                apr_pool_create(&ctx->deferred_write_pool, c->pool);
-            }
-            ap_save_brigade(f, &ctx->b, &b, ctx->deferred_write_pool);
+            ap_save_brigade(f, &ctx->b, &b, c->pool);
 
             return APR_SUCCESS;
         }
@@ -3999,30 +3995,6 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
         }
 
         apr_brigade_destroy(b);
-        
-        /* drive cleanups for resources which were set aside 
-         * this may occur before or after termination of the request which
-         * created the resource
-         */
-        if (ctx->deferred_write_pool) {
-            if (more && more->p == ctx->deferred_write_pool) {
-                /* "more" belongs to the deferred_write_pool,
-                 * which is about to be cleared.
-                 */
-                if (APR_BRIGADE_EMPTY(more)) {
-                    more = NULL;
-                }
-                else {
-                    /* uh oh... change more's lifetime 
-                     * to the input brigade's lifetime 
-                     */
-                    apr_bucket_brigade *tmp_more = more;
-                    more = NULL;
-                    ap_save_brigade(f, &more, &tmp_more, input_pool);
-                }
-            }
-            apr_pool_clear(ctx->deferred_write_pool);  
-        }
 
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server,