]> granicus.if.org Git - apache/commitdiff
We can not use heap buckets for data that was allocated out of a pool.
authorRyan Bloom <rbb@apache.org>
Tue, 14 Nov 2000 01:46:39 +0000 (01:46 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 14 Nov 2000 01:46:39 +0000 (01:46 +0000)
The basic problem is that when the pool is destroyed, the data will go
away unless it is in a pool bucket.  If it is in a pool bucket, then the
data will be copied into a heap bucket when the pool is destroyed.  This
becomes a real issue when we set some data off to the side to deal with
pipelined requests.

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

modules/http/http_core.c

index 045698505dbe74ab15e14fe726c7e7b23edde293..3cc1166175b4350675e0fbbf60b41116239d53c3 100644 (file)
@@ -2964,9 +2964,6 @@ static int default_handler(request_rec *r)
  * non-contiguous buckets. For example, if a brigade contains 10 small 
  * buckets followed by a large bucket (or a pipe or file bucket) followed 
  * by more small buckets, only the first 10 buckets will be coalesced.
- *
- * Yack... Using heap buckets which is really inefficient (multiple byte moves)
- * until we get heap bucket pooling in place.
  */
 typedef struct COALESCE_FILTER_CTX {
     char *buf;           /* Start of buffer */
@@ -3060,11 +3057,11 @@ static apr_status_t coalesce_filter(ap_filter_t *f, ap_bucket_brigade *b)
     if (pass_the_brigade) {
         /* Insert ctx->buf into the correct spot in the brigade */
         if (insert_first) {
-            e = ap_bucket_create_heap(ctx->buf, ctx->cnt, 1, NULL);
+            e = ap_bucket_create_pool(ctx->buf, ctx->cnt, 1, NULL);
             AP_BRIGADE_INSERT_HEAD(b, e);
         } 
         else if (insert_before) {
-            e = ap_bucket_create_heap(ctx->buf, ctx->cnt, 1, NULL);
+            e = ap_bucket_create_pool(ctx->buf, ctx->cnt, 1, NULL);
             AP_BUCKET_INSERT_BEFORE(e, insert_before);
             AP_BUCKET_REMOVE(insert_before);
             ap_bucket_destroy(insert_before);