]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add a pool to the ap_save_brigade prototype. This removes a todo from
authorRyan Bloom <rbb@apache.org>
Wed, 13 Jun 2001 13:44:40 +0000 (13:44 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 13 Jun 2001 13:44:40 +0000 (13:44 +0000)
the comments that is really necessary before the setaside stuff will
work properly.

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

include/util_filter.h
modules/filters/mod_include.c
modules/http/http_protocol.c
server/core.c
server/protocol.c
server/util_filter.c

index 430e9ee945c3215f8cbb88f5094be6c99a0b6c8c..e595686e1fdc1aaef0174a93665514634ffa165f 100644 (file)
@@ -378,9 +378,10 @@ AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f);
  *             new bucket brigade is returned in this location.
  * @param b The bucket brigade to save aside.  This brigade is always empty
  *          on return
+ * @param p Ensure that all data in the brigade lives as long as this pool
  */
 AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, apr_bucket_brigade **save_to,
-                                         apr_bucket_brigade **b);    
+                                         apr_bucket_brigade **b, apr_pool_t *p);    
 
 /**
  * Flush function for apr_brigade_* calls.  This calls ap_pass_brigade
index 589ff6bf5bd2d0e893a9730a5eca6a026a5689d4..503c73b69518561a4c3604286694687afeb8444b 100644 (file)
@@ -2620,7 +2620,7 @@ static void send_parsed_content(apr_bucket_brigade **bb, request_rec *r,
             }
                            /* Set aside tag, pass pre-tag... */
             tag_and_after = apr_brigade_split(*bb, ctx->head_start_bucket);
-            ap_save_brigade(f, &ctx->ssi_tag_brigade, &tag_and_after);
+            ap_save_brigade(f, &ctx->ssi_tag_brigade, &tag_and_after, r->pool);
             ap_pass_brigade(f->next, *bb);
             ctx->bytes_parsed = 0;
         }
index 0d2b9ed65e5c1901ee7e655013ba16240a66505e..b5e6b4b107ab39303ecad728311b3e3d992675c7 100644 (file)
@@ -2282,7 +2282,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(
      * we SHOULD return the data in the same order it was requested. 
      */
     if (!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
-        ap_save_brigade(f, &ctx->bb, &bb);
+        ap_save_brigade(f, &ctx->bb, &bb, r->pool);
         return APR_SUCCESS;
     }
 
index ec32496feb9636a3c35339d9d2531ff13d589b36..c1bc54dc44547758e202d5052484fda9408d30eb 100644 (file)
@@ -2966,7 +2966,7 @@ static int default_handler(request_rec *r)
         return HTTP_METHOD_NOT_ALLOWED;
     }
     main_pool = (r->main) ? (r->main->pool) : (r->pool);
-       
+
     if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0, main_pool)) != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
                     "file permissions deny server access: %s", r->filename);
@@ -3173,7 +3173,7 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
                 apr_brigade_destroy(b);
             }
             else {
-                ap_save_brigade(f, &ctx->b, &b);
+                ap_save_brigade(f, &ctx->b, &b, c->pool);
             }
             return APR_SUCCESS;
         }
index 5bf304969dbd30647b48282e9f5ba84f0a9a5d53..d0b9b2a094d65f51416467268cfb686a452a78db 100644 (file)
@@ -881,7 +881,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
     }
 
     if ((ctx->curr_len < AP_MIN_BYTES_TO_WRITE) && !send_it) {
-        return ap_save_brigade(f, &ctx->saved, &b);
+        return ap_save_brigade(f, &ctx->saved, &b, r->pool);
     }
 
     /* We will compute a content length if:
@@ -911,7 +911,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter(ap_filter_t *f,
          * filter until we have the entire content length
          */
         if (!send_it) {
-            ap_save_brigade(f, &ctx->saved, &b);
+            ap_save_brigade(f, &ctx->saved, &b, r->pool);
             return APR_SUCCESS;
         }
         ap_set_content_length(r, r->bytes_sent);
index 8e8f77073603cc46a31a6344ad67e9c3337163ae..86833583aa83faa9122252c1317e1367db2430a3 100644 (file)
@@ -245,12 +245,9 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next, apr_bucket_brigade *
 }
 
 AP_DECLARE(apr_status_t) ap_save_brigade(ap_filter_t *f, apr_bucket_brigade **saveto,
-                                         apr_bucket_brigade **b)
+                                         apr_bucket_brigade **b, apr_pool_t *p)
 {
     apr_bucket *e;
-    /* ### this pool should be passed in; the caller is the only one who
-       ### really knows what the proper lifetime is for this pool. */
-    apr_pool_t *p = f->r ? f->r->pool : f->c->pool;
     apr_status_t rv;
 
     /* If have never stored any data in the filter, then we had better