httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Fri, 29 Mar 2002 08:17:26 GMT
jwoolley    02/03/29 00:17:26

  Modified:    .        CHANGES STATUS
               include  ap_mmn.h http_connection.h http_protocol.h httpd.h
               modules/arch/win32 mod_isapi.c
               modules/cache mod_file_cache.c
               modules/dav/fs repos.c
               modules/echo mod_echo.c
               modules/experimental mod_cache.c mod_case_filter.c
                        mod_case_filter_in.c mod_charset_lite.c
                        mod_deflate.c mod_disk_cache.c mod_ext_filter.c
                        mod_mem_cache.c
               modules/filters mod_include.c mod_include.h
               modules/generators mod_asis.c mod_cgi.c mod_cgid.c
               modules/http http_core.c http_protocol.c http_request.c
               modules/mappers mod_negotiation.c
               modules/proxy proxy_ftp.c proxy_http.c
               modules/ssl ssl_engine_io.c
               modules/test mod_bucketeer.c
               server   connection.c core.c error_bucket.c protocol.c
                        util_filter.c
               server/mpm/beos beos.c
               server/mpm/mpmt_os2 mpmt_os2_child.c
               server/mpm/netware mpm_netware.c
               server/mpm/perchild perchild.c
               server/mpm/prefork prefork.c
               server/mpm/winnt mpm_winnt.c
               server/mpm/worker worker.c
  Log:
  BUCKET FREELISTS
  
  Add an allocator-passing mechanism throughout the bucket brigades API.
  
  From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
  connection is stored in the conn_rec by the create_connection hook.  That
  means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
  the MPM must ensure that no two threads can ever use the same one at the
  same time, for instance.
  
  Revision  Changes    Path
  1.668     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.667
  retrieving revision 1.668
  diff -u -d -u -r1.667 -r1.668
  --- CHANGES	29 Mar 2002 06:26:02 -0000	1.667
  +++ CHANGES	29 Mar 2002 08:17:18 -0000	1.668
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.35
   
  +  *) Change bucket brigades API to allow a "bucket allocator" to be
  +     passed in at certain points.  This allows us to implement freelists
  +     so that we can stop using malloc/free so frequently.
  +     [Cliff Woolley, Brian Pane]
  +
     *) Add support for macro expansion within the variable names in
        <!--#echo--> and <!--#set--> directives [Brian Pane]
   
  
  
  
  1.565     +3 -13     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.564
  retrieving revision 1.565
  diff -u -d -u -r1.564 -r1.565
  --- STATUS	26 Mar 2002 20:35:50 -0000	1.564
  +++ STATUS	29 Mar 2002 08:17:19 -0000	1.565
  @@ -1,5 +1,5 @@
   APACHE 2.0 STATUS:                                              -*-text-*-
  -Last modified at [$Date: 2002/03/26 20:35:50 $]
  +Last modified at [$Date: 2002/03/29 08:17:19 $]
   
   Release:
   
  @@ -49,10 +49,6 @@
   
   FINAL RELEASE SHOWSTOPPERS:
   
  -    * API changes planned for 2.0 that should happen before the
  -      GA release:
  -          * Free lists for bucket allocation
  -
       * We do not properly substitute the prefix-variables in the configuration
         scripts or generated-configs.  (i.e. if sysconfdir is etc,
         httpd-std.conf points to conf.)
  @@ -311,14 +307,8 @@
         bands, double free detection, etc. would be cool but certainly
         not a hard requirement.
   
  -          Status: Cliff started to implement this using SMS as has
  -                  been discussed at length for months, but since
  -                  SMS is not being used anywhere else in the server,
  -                  several people expressed the opinion that we should
  -                  get rid of it entirely, meaning that the buckets
  -                  need their own memory management (free list) functions.
  -                  Cliff will implement that this weekend so we at least
  -                  have something to look at/compare with.
  +          Status: The necessary API changes are in... apr_buckets_alloc.c
  +                  just needs to be fleshed out.
   
       * Eliminate unnecessary creation of pipes in mod_cgid
   
  
  
  
  1.41      +2 -1      httpd-2.0/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_mmn.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -d -u -r1.40 -r1.41
  --- ap_mmn.h	27 Mar 2002 22:42:16 -0000	1.40
  +++ ap_mmn.h	29 Mar 2002 08:17:19 -0000	1.41
  @@ -102,12 +102,13 @@
    * 20020318 (2.0.34-dev) mod_dav's API for REPORT generation changed
    * 20020319 (2.0.34-dev) M_INVALID changed, plus new M_* methods for RFC 3253
    * 20020327 (2.0.35-dev) Add parameter to quick_handler hook
  + * 20020329 (2.0.35-dev) bump for addition of freelists to bucket API
    */
   
   #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
   
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
  -#define MODULE_MAGIC_NUMBER_MAJOR 20020327
  +#define MODULE_MAGIC_NUMBER_MAJOR 20020329
   #endif
   #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
   #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR	/* backward compat */
  
  
  
  1.54      +3 -1      httpd-2.0/include/http_connection.h
  
  Index: http_connection.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_connection.h,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -d -u -r1.53 -r1.54
  --- http_connection.h	13 Mar 2002 20:47:42 -0000	1.53
  +++ http_connection.h	29 Mar 2002 08:17:19 -0000	1.54
  @@ -57,6 +57,7 @@
   
   #include "apr_hooks.h"
   #include "apr_network_io.h"
  +#include "apr_buckets.h"
   
   #ifdef __cplusplus
   extern "C" {
  @@ -114,7 +115,8 @@
    * @return An allocated connection record or NULL.
    */
   AP_DECLARE_HOOK(conn_rec *, create_connection,
  -                (apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh))
  +                (apr_pool_t *p, server_rec *server, apr_socket_t *csd,
  +                 long conn_id, void *sbh, apr_bucket_alloc_t *alloc))
      
   /**
    * This hook gives protocol modules an opportunity to set everything up
  
  
  
  1.75      +6 -4      httpd-2.0/include/http_protocol.h
  
  Index: http_protocol.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_protocol.h,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -d -u -r1.74 -r1.75
  --- http_protocol.h	20 Mar 2002 17:44:13 -0000	1.74
  +++ http_protocol.h	29 Mar 2002 08:17:19 -0000	1.75
  @@ -666,12 +666,14 @@
    * Create a bucket referring to an HTTP error.
    * @param error The HTTP error code to put in the bucket. 
    * @param buf An optional error string to put in the bucket.
  - * @param p A pool to allocate out of.
  + * @param p A pool to allocate the error string out of.
  + * @param list The bucket allocator from which to allocate the bucket
    * @return The new bucket, or NULL if allocation failed
  - * @deffunc apr_bucket *ap_bucket_error_create(int error, const char *buf, apr_pool_t *p)
  + * @deffunc apr_bucket *ap_bucket_error_create(int error, const char *buf, apr_pool_t *p, apr_bucket_alloc_t *list)
    */
  -AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error,
  -                const char *buf, apr_pool_t *p);
  +AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, const char *buf,
  +                                                apr_pool_t *p,
  +                                                apr_bucket_alloc_t *list);
   
   AP_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f, apr_bucket_brigade *b);
   AP_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, apr_bucket_brigade *b);
  
  
  
  1.182     +2 -0      httpd-2.0/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/httpd.h,v
  retrieving revision 1.181
  retrieving revision 1.182
  diff -u -d -u -r1.181 -r1.182
  --- httpd.h	19 Mar 2002 10:11:33 -0000	1.181
  +++ httpd.h	29 Mar 2002 08:17:19 -0000	1.182
  @@ -1008,6 +1008,8 @@
       struct ap_filter_t *output_filters;
       /** handle to scoreboard information for this connection */
       void *sbh;
  +    /** The bucket allocator to use for all bucket/brigade creations */
  +    struct apr_bucket_alloc_t *bucket_alloc;
   };
   
   /* Per-vhost config... */
  
  
  
  1.62      +20 -15    httpd-2.0/modules/arch/win32/mod_isapi.c
  
  Index: mod_isapi.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/arch/win32/mod_isapi.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -d -u -r1.61 -r1.62
  --- mod_isapi.c	16 Mar 2002 18:26:57 -0000	1.61
  +++ mod_isapi.c	29 Mar 2002 08:17:20 -0000	1.62
  @@ -646,16 +646,17 @@
                            DWORD dwReserved)
   {
       request_rec *r = ((isapi_cid *)ConnID)->r;
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *b;
   
       if (dwReserved == HSE_IO_SYNC)
           ; /* XXX: Fake it */
   
  -    bb = apr_brigade_create(r->pool);
  -    b = apr_bucket_transient_create(Buffer, *lpdwBytes);
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_transient_create(Buffer, *lpdwBytes, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
  -    b = apr_bucket_flush_create();
  +    b = apr_bucket_flush_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       ap_pass_brigade(r->output_filters, bb);
   
  @@ -739,6 +740,7 @@
   {
       isapi_cid *cid = (isapi_cid *)hConn;
       request_rec *r = cid->r;
  +    conn_rec *c = r->connection;
       request_rec *subreq;
   
       switch (dwHSERequest) {
  @@ -792,11 +794,11 @@
           else if ((apr_size_t)ate < headlen) {
               apr_bucket_brigade *bb;
               apr_bucket *b;
  -            bb = apr_brigade_create(cid->r->pool);
  +            bb = apr_brigade_create(cid->r->pool, c->bucket_alloc);
   	    b = apr_bucket_transient_create((char*) lpdwDataType + ate, 
  -                                           headlen - ate);
  +                                           headlen - ate, c->bucket_alloc);
   	    APR_BRIGADE_INSERT_TAIL(bb, b);
  -            b = apr_bucket_flush_create();
  +            b = apr_bucket_flush_create(c->bucket_alloc);
   	    APR_BRIGADE_INSERT_TAIL(bb, b);
   	    ap_pass_brigade(cid->r->output_filters, bb);
           }
  @@ -897,7 +899,7 @@
           }
           
           /* apr_dupfile_oshandle (&fd, tf->hFile, r->pool); */
  -        bb = apr_brigade_create(r->pool);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
   
           if (tf->dwFlags & HSE_IO_SEND_HEADERS) 
           {
  @@ -923,27 +925,29 @@
               if ((apr_size_t)ate < tf->HeadLength)
               {
                   b = apr_bucket_transient_create((char*)tf->pHead + ate, 
  -                                                tf->HeadLength - ate);
  +                                                tf->HeadLength - ate,
  +                                                c->bucket_alloc);
                   APR_BRIGADE_INSERT_TAIL(bb, b);
               }
           }
           else if (tf->pHead && tf->HeadLength) {
               b = apr_bucket_transient_create((char*)tf->pHead, 
  -                                            tf->HeadLength);
  +                                            tf->HeadLength,
  +                                            c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, b);
           }
   
           b = apr_bucket_file_create(fd, tf->Offset, 
  -                                   tf->BytesToWrite, r->pool);
  +                                   tf->BytesToWrite, r->pool, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           
           if (tf->pTail && tf->TailLength) {
               b = apr_bucket_transient_create((char*)tf->pTail, 
  -                                            tf->TailLength);
  +                                            tf->TailLength, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, b);
           }
           
  -        b = apr_bucket_flush_create();
  +        b = apr_bucket_flush_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           ap_pass_brigade(r->output_filters, bb);
   
  @@ -1095,11 +1099,12 @@
           else if ((apr_size_t)ate < shi->cchHeader) {
               apr_bucket_brigade *bb;
               apr_bucket *b;
  -            bb = apr_brigade_create(cid->r->pool);
  +            bb = apr_brigade_create(cid->r->pool, c->bucket_alloc);
   	    b = apr_bucket_transient_create(shi->pszHeader + ate, 
  -                                            shi->cchHeader - ate);
  +                                            shi->cchHeader - ate,
  +                                            c->bucket_alloc);
   	    APR_BRIGADE_INSERT_TAIL(bb, b);
  -            b = apr_bucket_flush_create();
  +            b = apr_bucket_flush_create(c->bucket_alloc);
   	    APR_BRIGADE_INSERT_TAIL(bb, b);
   	    ap_pass_brigade(cid->r->output_filters, bb);
           }
  
  
  
  1.70      +10 -7     httpd-2.0/modules/cache/mod_file_cache.c
  
  Index: mod_file_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/cache/mod_file_cache.c,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -d -u -r1.69 -r1.70
  --- mod_file_cache.c	16 Mar 2002 18:26:57 -0000	1.69
  +++ mod_file_cache.c	29 Mar 2002 08:17:20 -0000	1.70
  @@ -349,12 +349,14 @@
   static int mmap_handler(request_rec *r, a_file *file)
   {
   #if APR_HAS_MMAP
  +    conn_rec *c = r->connection;
       apr_bucket *b;
  -    apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  +    apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
   
  -    b = apr_bucket_mmap_create(file->mm, 0, (apr_size_t)file->finfo.size);
  +    b = apr_bucket_mmap_create(file->mm, 0, (apr_size_t)file->finfo.size,
  +                               c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
  -    b = apr_bucket_eos_create();
  +    b = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
   
       if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
  @@ -366,13 +368,14 @@
   static int sendfile_handler(request_rec *r, a_file *file)
   {
   #if APR_HAS_SENDFILE
  +    conn_rec *c = r->connection;
       apr_bucket *b;
  -    apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  +    apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
   
  -    b = apr_bucket_file_create(file->file, 0, 
  -                               (apr_size_t)file->finfo.size, r->pool);
  +    b = apr_bucket_file_create(file->file, 0, (apr_size_t)file->finfo.size,
  +                               r->pool, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
  -    b = apr_bucket_eos_create();
  +    b = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
   
       if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
  
  
  
  1.68      +4 -3      httpd-2.0/modules/dav/fs/repos.c
  
  Index: repos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/fs/repos.c,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -d -u -r1.67 -r1.68
  --- repos.c	21 Mar 2002 10:10:40 -0000	1.67
  +++ repos.c	29 Mar 2002 08:17:20 -0000	1.68
  @@ -59,6 +59,7 @@
   #include "apr.h"
   #include "apr_file_io.h"
   #include "apr_strings.h"
  +#include "apr_buckets.h"
   
   #if APR_HAVE_STDIO_H
   #include <stdio.h>              /* for sprintf() */
  @@ -995,15 +996,15 @@
                                "File permissions deny server access.");
       }
   
  -    bb = apr_brigade_create(pool);
  +    bb = apr_brigade_create(pool, output->c->bucket_alloc);
   
       /* ### this does not handle large files. but this is test code anyway */
       bkt = apr_bucket_file_create(fd, 0,
                                    (apr_size_t)resource->info->finfo.size,
  -                                 pool);
  +                                 pool, output->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
   
  -    bkt = apr_bucket_eos_create();
  +    bkt = apr_bucket_eos_create(output->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
   
       if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS) {
  
  
  
  1.39      +2 -2      httpd-2.0/modules/echo/mod_echo.c
  
  Index: mod_echo.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/echo/mod_echo.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -d -u -r1.38 -r1.39
  --- mod_echo.c	13 Mar 2002 20:47:46 -0000	1.38
  +++ mod_echo.c	29 Mar 2002 08:17:20 -0000	1.39
  @@ -101,7 +101,7 @@
           return DECLINED;
       }
       
  -    bb = apr_brigade_create(c->pool);
  +    bb = apr_brigade_create(c->pool, c->bucket_alloc);
   
       for ( ; ; ) {
           /* Get a single line of input from the client */
  @@ -113,7 +113,7 @@
           }
   
           /* Make sure the data is flushed to the client */
  -        b = apr_bucket_flush_create();
  +        b = apr_bucket_flush_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           ap_pass_brigade(c->output_filters, bb);    
       }
  
  
  
  1.39      +2 -1      httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -d -u -r1.38 -r1.39
  --- mod_cache.c	27 Mar 2002 22:42:16 -0000	1.38
  +++ mod_cache.c	29 Mar 2002 08:17:20 -0000	1.39
  @@ -202,6 +202,7 @@
           /* cache file exists */
           if (cache->fresh) {
               apr_bucket_brigade *out;
  +            conn_rec *c = r->connection;
   
               /* fresh data available */
               if (lookup) {
  @@ -227,7 +228,7 @@
               ap_add_output_filter("CACHE_OUT", NULL, r, r->connection);
   
               /* kick off the filter stack */
  -            out = apr_brigade_create(r->pool);
  +            out = apr_brigade_create(r->pool, c->bucket_alloc);
               if (APR_SUCCESS != (rv = ap_pass_brigade(r->output_filters, out))) {
                   ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                                "cache: error returned while trying to return %s "
  
  
  
  1.11      +7 -6      httpd-2.0/modules/experimental/mod_case_filter.c
  
  Index: mod_case_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_case_filter.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -d -u -r1.10 -r1.11
  --- mod_case_filter.c	10 Mar 2002 20:49:29 -0000	1.10
  +++ mod_case_filter.c	29 Mar 2002 08:17:21 -0000	1.11
  @@ -40,11 +40,12 @@
   static apr_status_t CaseFilterOutFilter(ap_filter_t *f,
   					apr_bucket_brigade *pbbIn)
       {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       apr_bucket *pbktIn;
       apr_bucket_brigade *pbbOut;
   
  -    /* XXX: is this the most appropriate pool? */
  -    pbbOut=apr_brigade_create(f->r->pool);
  +    pbbOut=apr_brigade_create(r->pool, c->bucket_alloc);
       APR_BRIGADE_FOREACH(pbktIn,pbbIn)
   	{
   	const char *data;
  @@ -55,8 +56,7 @@
   
   	if(APR_BUCKET_IS_EOS(pbktIn))
   	    {
  -            /* XXX: why can't I reuse pbktIn??? */
  -	    apr_bucket *pbktEOS=apr_bucket_eos_create();
  +	    apr_bucket *pbktEOS=apr_bucket_eos_create(c->bucket_alloc);
   	    APR_BRIGADE_INSERT_TAIL(pbbOut,pbktEOS);
   	    continue;
   	    }
  @@ -65,11 +65,12 @@
   	apr_bucket_read(pbktIn,&data,&len,APR_BLOCK_READ);
   
   	/* write */
  -	buf=malloc(len);
  +	buf = apr_bucket_alloc(len, c->bucket_alloc);
   	for(n=0 ; n < len ; ++n)
   	    buf[n]=toupper(data[n]);
   
  -	pbktOut=apr_bucket_heap_create(buf,len,0);
  +	pbktOut = apr_bucket_heap_create(buf, len, apr_bucket_free,
  +	                                 c->bucket_alloc);
   	APR_BRIGADE_INSERT_TAIL(pbbOut,pbktOut);
   	}
   
  
  
  
  1.15      +3 -2      httpd-2.0/modules/experimental/mod_case_filter_in.c
  
  Index: mod_case_filter_in.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_case_filter_in.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -d -u -r1.14 -r1.15
  --- mod_case_filter_in.c	13 Mar 2002 20:47:46 -0000	1.14
  +++ mod_case_filter_in.c	29 Mar 2002 08:17:21 -0000	1.15
  @@ -105,12 +105,13 @@
                                          apr_off_t nBytes)
   {
       request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       CaseFilterInContext *pCtx;
       apr_status_t ret;
   
       if (!(pCtx = f->ctx)) {
           f->ctx = pCtx = apr_palloc(r->pool, sizeof *pCtx);
  -        pCtx->pbbTmp = apr_brigade_create(r->pool);
  +        pCtx->pbbTmp = apr_brigade_create(r->pool, c->bucket_alloc);
       }
   
       if (APR_BRIGADE_EMPTY(pCtx->pbbTmp)) {
  @@ -149,7 +150,7 @@
           for(n=0 ; n < len ; ++n)
               buf[n] = toupper(data[n]);
   
  -        pbktOut = apr_bucket_heap_create(buf, len, 0);
  +        pbktOut = apr_bucket_heap_create(buf, len, 0, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(pbbOut, pbktOut);
           apr_bucket_delete(pbktIn);
       }
  
  
  
  1.61      +12 -6     httpd-2.0/modules/experimental/mod_charset_lite.c
  
  Index: mod_charset_lite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_charset_lite.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -d -u -r1.60 -r1.61
  --- mod_charset_lite.c	13 Mar 2002 20:47:46 -0000	1.60
  +++ mod_charset_lite.c	29 Mar 2002 08:17:21 -0000	1.61
  @@ -347,7 +347,8 @@
            * of it.
            */
           input_ctx = apr_pcalloc(r->pool, sizeof(charset_filter_ctx_t));
  -        input_ctx->bb = apr_brigade_create(r->pool);
  +        input_ctx->bb = apr_brigade_create(r->pool,
  +                                           r->connection->bucket_alloc);
           input_ctx->tmp = apr_palloc(r->pool, INPUT_XLATE_BUF_SIZE);
           input_ctx->dc = dc;
           reqinfo->input_ctx = input_ctx;
  @@ -443,13 +444,15 @@
    */
   static apr_status_t send_downstream(ap_filter_t *f, const char *tmp, apr_size_t len)
   {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *b;
       charset_filter_ctx_t *ctx = f->ctx;
       apr_status_t rv;
   
  -    bb = apr_brigade_create(f->r->pool);
  -    b = apr_bucket_transient_create(tmp, len);
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_transient_create(tmp, len, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       rv = ap_pass_brigade(f->next, bb);
       if (rv != APR_SUCCESS) {
  @@ -460,13 +463,15 @@
   
   static apr_status_t send_eos(ap_filter_t *f)
   {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *b;
       charset_filter_ctx_t *ctx = f->ctx;
       apr_status_t rv;
   
  -    bb = apr_brigade_create(f->r->pool);
  -    b = apr_bucket_eos_create();
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       rv = ap_pass_brigade(f->next, bb);
       if (rv != APR_SUCCESS) {
  @@ -1053,7 +1058,8 @@
               apr_bucket *e;
   
               e = apr_bucket_heap_create(ctx->tmp, 
  -                                      INPUT_XLATE_BUF_SIZE - buffer_size, 1);
  +                                       INPUT_XLATE_BUF_SIZE - buffer_size,
  +                                       NULL, f->r->connection->bucket_alloc);
               /* make sure we insert at the head, because there may be
                * an eos bucket already there, and the eos bucket should 
                * come after the data
  
  
  
  1.12      +8 -6      httpd-2.0/modules/experimental/mod_deflate.c
  
  Index: mod_deflate.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_deflate.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -d -u -r1.11 -r1.12
  --- mod_deflate.c	13 Mar 2002 20:47:46 -0000	1.11
  +++ mod_deflate.c	29 Mar 2002 08:17:21 -0000	1.12
  @@ -273,8 +273,8 @@
           }
   
           /* We're cool with filtering this. */
  -        ctx = f->ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
  -        ctx->bb = apr_brigade_create(f->r->pool);
  +        ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
  +        ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
   /*
           ctx->stream.zalloc = (alloc_func) 0;
           ctx->stream.zfree = (free_func) 0;
  @@ -297,7 +297,7 @@
           buf = apr_psprintf(r->pool, "%c%c%c%c%c%c%c%c%c%c", deflate_magic[0],
                              deflate_magic[1], Z_DEFLATED, 0 /* flags */ , 0, 0,
                              0, 0 /* time */ , 0 /* xflags */ , OS_CODE);
  -        e = apr_bucket_pool_create(buf, 10, r->pool);
  +        e = apr_bucket_pool_create(buf, 10, r->pool, f->c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(ctx->bb, e);
   
           apr_table_setn(r->headers_out, "Content-Encoding", "gzip");
  @@ -323,7 +323,8 @@
   
                   if (deflate_len != 0) {
                       b = apr_bucket_heap_create((char *)ctx->buffer,
  -                                               deflate_len, 1);
  +                                               deflate_len, NULL,
  +                                               f->c->bucket_alloc);
                       APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
                       ctx->stream.next_out = ctx->buffer;
                       ctx->stream.avail_out = FILTER_BUFSIZE;
  @@ -359,7 +360,7 @@
               *p++ = len_array[2];
               *p++ = len_array[3];
   
  -            b = apr_bucket_pool_create(buf, 8, r->pool);
  +            b = apr_bucket_pool_create(buf, 8, r->pool, f->c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
               ap_log_rerror(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r,
                             "Zlib: Compressed %ld to %ld : URL %s",
  @@ -421,7 +422,8 @@
                   ctx->stream.next_out = ctx->buffer;
                   len = FILTER_BUFSIZE - ctx->stream.avail_out;
   
  -                b = apr_bucket_heap_create((char *)ctx->buffer, len, 1);
  +                b = apr_bucket_heap_create((char *)ctx->buffer, len,
  +                                           NULL, f->c->bucket_alloc);
                   APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
                   ctx->stream.avail_out = FILTER_BUFSIZE;
               }
  
  
  
  1.29      +3 -3      httpd-2.0/modules/experimental/mod_disk_cache.c
  
  Index: mod_disk_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -d -u -r1.28 -r1.29
  --- mod_disk_cache.c	13 Mar 2002 20:47:46 -0000	1.28
  +++ mod_disk_cache.c	29 Mar 2002 08:17:21 -0000	1.29
  @@ -504,10 +504,10 @@
       apr_bucket *e;
       disk_cache_object_t *dobj = (disk_cache_object_t*) h->cache_obj->vobj;
   
  -    e = apr_bucket_file_create(dobj->fd, 0, dobj->file_size, p);
  -
  +    e = apr_bucket_file_create(dobj->fd, 0, dobj->file_size, p,
  +                               bb->bucket_alloc);
       APR_BRIGADE_INSERT_HEAD(bb, e);
  -    e = apr_bucket_eos_create();
  +    e = apr_bucket_eos_create(bb->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, e);
   
       return APR_SUCCESS;
  
  
  
  1.26      +19 -15    httpd-2.0/modules/experimental/mod_ext_filter.c
  
  Index: mod_ext_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_ext_filter.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -d -u -r1.25 -r1.26
  --- mod_ext_filter.c	22 Mar 2002 11:45:26 -0000	1.25
  +++ mod_ext_filter.c	29 Mar 2002 08:17:21 -0000	1.26
  @@ -532,6 +532,8 @@
    */
   static apr_status_t drain_available_output(ap_filter_t *f)
   {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       ef_ctx_t *ctx = f->ctx;
       ef_dir_t *dc = ctx->dc;
       apr_size_t len;
  @@ -547,18 +549,18 @@
                         &len);
           if ((rv && !APR_STATUS_IS_EAGAIN(rv)) ||
               dc->debug >= DBGLVL_GORY) {
  -            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r,
                             "apr_file_read(child output), len %" APR_SIZE_T_FMT,
                             !rv ? len : -1);
           }
           if (rv != APR_SUCCESS) {
               return rv;
           }
  -        bb = apr_brigade_create(f->r->pool);
  -        b = apr_bucket_transient_create(buf, len);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        b = apr_bucket_transient_create(buf, len, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           if ((rv = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                             "ap_pass_brigade()");
               return rv;
           }
  @@ -632,6 +634,8 @@
   
   static apr_status_t ef_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
   {
  +    request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       ef_ctx_t *ctx = f->ctx;
       apr_bucket *b;
       ef_dir_t *dc;
  @@ -662,7 +666,7 @@
   
           rv = apr_bucket_read(b, &data, &len, APR_BLOCK_READ);
           if (rv != APR_SUCCESS) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r, "apr_bucket_read()");
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "apr_bucket_read()");
               return rv;
           }
   
  @@ -682,7 +686,7 @@
            * that will cause the child to finish generating output
            */
           if ((rv = apr_file_close(ctx->proc->in)) != APR_SUCCESS) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                             "apr_file_close(child input)");
               return rv;
           }
  @@ -690,9 +694,9 @@
            * timeout; we don't care if we don't return from apr_file_read() for a while... 
            */
           rv = apr_file_pipe_timeout_set(ctx->proc->out, 
  -                                  f->r->server->timeout * APR_USEC_PER_SEC);
  +                                  r->server->timeout * APR_USEC_PER_SEC);
           if (rv) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                             "apr_file_pipe_timeout_set(child output)");
               return rv;
           }
  @@ -705,7 +709,7 @@
                         &len);
           if ((rv && !APR_STATUS_IS_EOF(rv) && !APR_STATUS_IS_EAGAIN(rv)) ||
               dc->debug >= DBGLVL_GORY) {
  -            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r,
                             "apr_file_read(child output), len %" APR_SIZE_T_FMT,
                             !rv ? len : -1);
           }
  @@ -718,11 +722,11 @@
           }
           
           if (rv == APR_SUCCESS) {
  -            bb = apr_brigade_create(f->r->pool);
  -            b = apr_bucket_transient_create(buf, len);
  +            bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +            b = apr_bucket_transient_create(buf, len, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, b);
               if ((rv = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) {
  -                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r,
  +                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                 "ap_pass_brigade(filtered buffer) failed");
                   return rv;
               }
  @@ -735,11 +739,11 @@
   
       if (eos) {
           /* pass down eos */
  -        bb = apr_brigade_create(f->r->pool);
  -        b = apr_bucket_eos_create();
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        b = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           if ((rv = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, f->r,
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                             "ap_pass_brigade(eos) failed");
               return rv;
           }
  
  
  
  1.42      +3 -3      httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -d -u -r1.41 -r1.42
  --- mod_mem_cache.c	18 Mar 2002 15:45:46 -0000	1.41
  +++ mod_mem_cache.c	29 Mar 2002 08:17:21 -0000	1.42
  @@ -646,14 +646,14 @@
           /* CACHE_TYPE_FILE */
           apr_file_t *file;
           apr_os_file_put(&file, &mobj->fd, APR_READ|APR_XTHREAD, p);
  -        b = apr_bucket_file_create(file, 0, mobj->m_len, p);
  +        b = apr_bucket_file_create(file, 0, mobj->m_len, p, bb->bucket_alloc);
       }
       else {
           /* CACHE_TYPE_HEAP */
  -        b = apr_bucket_immortal_create(mobj->m, mobj->m_len);
  +        b = apr_bucket_immortal_create(mobj->m, mobj->m_len, bb->bucket_alloc);
       }
       APR_BRIGADE_INSERT_TAIL(bb, b);
  -    b = apr_bucket_eos_create();
  +    b = apr_bucket_eos_create(bb->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
   
       return APR_SUCCESS;
  
  
  
  1.213     +23 -13    httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.212
  retrieving revision 1.213
  diff -u -d -u -r1.212 -r1.213
  --- mod_include.c	29 Mar 2002 05:58:39 -0000	1.212
  +++ mod_include.c	29 Mar 2002 08:17:21 -0000	1.213
  @@ -1358,6 +1358,7 @@
                   }
               }
               if (!strcmp(tag, "var")) {
  +                conn_rec *c = r->connection;
                   const char *val =
                       get_include_var(r, ctx,
                                       ap_ssi_parse_string(r, ctx, tag_val, NULL,
  @@ -1377,7 +1378,7 @@
   
                       e_len = strlen(echo_text);
                       tmp_buck = apr_bucket_pool_create(echo_text, e_len,
  -                                                      r->pool);
  +                                                      r->pool, c->bucket_alloc);
                   }
                   else {
                       include_server_config *sconf= 
  @@ -1385,7 +1386,7 @@
                                                &include_module);
                       tmp_buck = apr_bucket_pool_create(sconf->undefinedEcho, 
                                                         sconf->undefinedEchoLen,
  -                                                      r->pool);
  +                                                      r->pool, c->bucket_alloc);
                   }
                   APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
                   if (*inserted_head == NULL) {
  @@ -1623,7 +1624,8 @@
                           s_len = pos;
                       }
   
  -                    tmp_buck = apr_bucket_heap_create(buff, s_len, 1);
  +                    tmp_buck = apr_bucket_heap_create(buff, s_len, NULL,
  +                                                  r->connection->bucket_alloc);
                       APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
                       if (*inserted_head == NULL) {
                           *inserted_head = tmp_buck;
  @@ -1671,7 +1673,8 @@
                       t_val = ap_ht_time(r->pool, finfo.mtime, ctx->time_str, 0);
                       t_len = strlen(t_val);
   
  -                    tmp_buck = apr_bucket_pool_create(t_val, t_len, r->pool);
  +                    tmp_buck = apr_bucket_pool_create(t_val, t_len, r->pool,
  +                                                  r->connection->bucket_alloc);
                       APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
                       if (*inserted_head == NULL) {
                           *inserted_head = tmp_buck;
  @@ -2504,8 +2507,9 @@
       if (cntx->flags & FLAG_COND_TRUE) {                                    \
           cond_txt[31] = '1';                                                \
       }                                                                      \
  -    memcpy(&cond_txt[5], tag_text, sizeof(tag_text));                      \
  -    t_buck = apr_bucket_heap_create(cond_txt, sizeof(cond_txt), 1);        \
  +    memcpy(&cond_txt[5], tag_text, sizeof(tag_text)-1);                    \
  +    t_buck = apr_bucket_heap_create(cond_txt, sizeof(cond_txt)-1,          \
  +                                    NULL, h_ptr->list);                    \
       APR_BUCKET_INSERT_BEFORE(h_ptr, t_buck);                               \
                                                                              \
       if (ins_head == NULL) {                                                \
  @@ -2515,7 +2519,8 @@
   #define DUMP_PARSE_EXPR_DEBUG(t_buck, h_ptr, d_buf, ins_head)            \
   {                                                                        \
       if (d_buf[0] != '\0') {                                              \
  -        t_buck = apr_bucket_heap_create(d_buf, strlen(d_buf), 1);        \
  +        t_buck = apr_bucket_heap_create(d_buf, strlen(d_buf),            \
  +                                        NULL, h_ptr->list);              \
           APR_BUCKET_INSERT_BEFORE(h_ptr, t_buck);                         \
                                                                            \
           if (ins_head == NULL) {                                          \
  @@ -2591,7 +2596,8 @@
                   if (1) {
                       apr_size_t d_len = 0;
                       d_len = sprintf(debug_buf, "**** if expr=\"%s\"\n", expr);
  -                    tmp_buck = apr_bucket_heap_create(debug_buf, d_len, 1);
  +                    tmp_buck = apr_bucket_heap_create(debug_buf, d_len, NULL,
  +                                                  r->connection->bucket_alloc);
                       APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
   
                       if (*inserted_head == NULL) {
  @@ -2673,7 +2679,8 @@
                   if (1) {
                       apr_size_t d_len = 0;
                       d_len = sprintf(debug_buf, "**** elif expr=\"%s\"\n", expr);
  -                    tmp_buck = apr_bucket_heap_create(debug_buf, d_len, 1);
  +                    tmp_buck = apr_bucket_heap_create(debug_buf, d_len, NULL,
  +                                                  r->connection->bucket_alloc);
                       APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
   
                       if (*inserted_head == NULL) {
  @@ -2854,7 +2861,8 @@
                   *next++ = '\n';
                   *next = 0;
                   tmp_buck = apr_bucket_pool_create(key_val, kv_length - 1,
  -                                                  r->pool);
  +                                                  r->pool,
  +                                                  r->connection->bucket_alloc);
                   APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
                   if (*inserted_head == NULL) {
                       *inserted_head = tmp_buck;
  @@ -2912,7 +2920,8 @@
                   apr_bucket *tmp_bkt;
   
                   tmp_bkt = apr_bucket_immortal_create(ctx->start_seq,
  -                                                     cleanup_bytes);
  +                                                  cleanup_bytes,
  +                                                  r->connection->bucket_alloc);
                   APR_BRIGADE_INSERT_HEAD(*bb, tmp_bkt);
                   apr_brigade_cleanup(ctx->ssi_tag_brigade);
               }
  @@ -2946,7 +2955,7 @@
                   /* Send the large chunk of pre-tag bytes...  */
                   tag_and_after = apr_brigade_split(*bb, tmp_dptr);
                   if (ctx->output_flush) {
  -                    APR_BRIGADE_INSERT_TAIL(*bb, apr_bucket_flush_create());
  +                    APR_BRIGADE_INSERT_TAIL(*bb, apr_bucket_flush_create((*bb)->bucket_alloc));
                   }
   
                   rv = ap_pass_brigade(f->next, *bb);
  @@ -3281,7 +3290,8 @@
           if (ap_allow_options(r) & OPT_INCNOEXEC) {
               ctx->flags |= FLAG_NO_EXEC;
           }
  -        ctx->ssi_tag_brigade = apr_brigade_create(f->c->pool);
  +        ctx->ssi_tag_brigade = apr_brigade_create(f->c->pool,
  +                                                  f->c->bucket_alloc);
           ctx->status = APR_SUCCESS;
   
           ctx->error_str = conf->default_error_msg;
  
  
  
  1.32      +3 -2      httpd-2.0/modules/filters/mod_include.h
  
  Index: mod_include.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.h,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -d -u -r1.31 -r1.32
  --- mod_include.h	13 Mar 2002 20:47:48 -0000	1.31
  +++ mod_include.h	29 Mar 2002 08:17:21 -0000	1.32
  @@ -189,7 +189,8 @@
   {                                                                 \
       /* XXX: it'd probably be nice to use a pool bucket here */    \
       t_buck = apr_bucket_heap_create(cntx->error_str,              \
  -                             strlen(cntx->error_str), 1);         \
  +                                    strlen(cntx->error_str),      \
  +                                    NULL, h_ptr->list);           \
       APR_BUCKET_INSERT_BEFORE(h_ptr, t_buck);                      \
                                                                     \
       if (ins_head == NULL) {                                       \
  @@ -208,7 +209,7 @@
                                                                         \
       tag_plus = apr_brigade_split((brgd), (cntxt)->head_start_bucket); \
       if ((cntxt)->output_flush) {                                      \
  -        APR_BRIGADE_INSERT_TAIL((brgd), apr_bucket_flush_create());   \
  +        APR_BRIGADE_INSERT_TAIL((brgd), apr_bucket_flush_create((brgd)->bucket_alloc));   \
       }                                                                 \
       (rc) = ap_pass_brigade((next), (brgd));                           \
       (cntxt)->bytes_parsed = 0;                                        \
  
  
  
  1.45      +7 -4      httpd-2.0/modules/generators/mod_asis.c
  
  Index: mod_asis.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_asis.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -d -u -r1.44 -r1.45
  --- mod_asis.c	13 Mar 2002 20:47:48 -0000	1.44
  +++ mod_asis.c	29 Mar 2002 08:17:22 -0000	1.45
  @@ -72,6 +72,7 @@
   
   static int asis_handler(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       apr_file_t *f = NULL;
       apr_status_t rv;
       const char *location;
  @@ -130,7 +131,7 @@
               return HTTP_INTERNAL_SERVER_ERROR;
           }
   
  -        bb = apr_brigade_create(r->pool);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
   #if APR_HAS_LARGE_FILES
           if (r->finfo.size - pos > AP_MAX_SENDFILE) {
               /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets, 
  @@ -138,7 +139,8 @@
                * in case the brigade code/filters attempt to read it directly.
                */
               apr_off_t fsize = r->finfo.size - pos;
  -            b = apr_bucket_file_create(f, pos, AP_MAX_SENDFILE, r->pool);
  +            b = apr_bucket_file_create(f, pos, AP_MAX_SENDFILE,
  +                                       r->pool, c->bucket_alloc);
               while (fsize > AP_MAX_SENDFILE) {
                   APR_BRIGADE_INSERT_TAIL(bb, b);
                   apr_bucket_copy(b, &b);
  @@ -149,9 +151,10 @@
           }
           else
   #endif
  -        b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos), r->pool);
  +        b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos),
  +                                   r->pool, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
  -        b = apr_bucket_eos_create();
  +        b = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           rv = ap_pass_brigade(r->output_filters, bb);
           if (rv != APR_SUCCESS) {
  
  
  
  1.129     +21 -13    httpd-2.0/modules/generators/mod_cgi.c
  
  Index: mod_cgi.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -d -u -r1.128 -r1.129
  --- mod_cgi.c	24 Mar 2002 02:55:35 -0000	1.128
  +++ mod_cgi.c	29 Mar 2002 08:17:22 -0000	1.129
  @@ -702,14 +702,15 @@
   
       /* Handle script return... */
       if (script_in && !nph) {
  +        conn_rec *c = r->connection;
   	const char *location;
   	char sbuf[MAX_STRING_LEN];
   	int ret;
   
  -        bb = apr_brigade_create(r->pool);
  -        b = apr_bucket_pipe_create(script_in);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        b = apr_bucket_pipe_create(script_in, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
  -        b = apr_bucket_eos_create();
  +        b = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
   
   	if ((ret = ap_scan_script_header_err_brigade(r, bb, sbuf))) {
  @@ -755,6 +756,7 @@
       }
   
       if (script_in && nph) {
  +        conn_rec *c = r->connection;
           struct ap_filter_t *cur;
           
           /* get rid of all filters up through protocol...  since we
  @@ -768,10 +770,10 @@
           }
           r->output_filters = r->proto_output_filters = cur;
   
  -        bb = apr_brigade_create(r->pool);
  -	b = apr_bucket_pipe_create(script_in);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +	b = apr_bucket_pipe_create(script_in, c->bucket_alloc);
   	APR_BRIGADE_INSERT_TAIL(bb, b);
  -	b = apr_bucket_eos_create();
  +	b = apr_bucket_eos_create(c->bucket_alloc);
   	APR_BRIGADE_INSERT_TAIL(bb, b);
           ap_pass_brigade(r->output_filters, bb);
       }
  @@ -825,6 +827,7 @@
       if (ap_is_HTTP_REDIRECT(rr_status)) {
           apr_size_t len_loc;
           const char *location = apr_table_get(rr->headers_out, "Location");
  +        conn_rec *c = r->connection;
   
           location = ap_escape_html(rr->pool, location);
           len_loc = strlen(location);
  @@ -834,15 +837,20 @@
            * and a single pool bucket */
   
           tmp_buck = apr_bucket_immortal_create("<A HREF=\"",
  -                                              sizeof("<A HREF=\"") - 1);
  +                                              sizeof("<A HREF=\"") - 1,
  +                                              c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
  -        tmp2_buck = apr_bucket_heap_create(location, len_loc, 1);
  +        tmp2_buck = apr_bucket_heap_create(location, len_loc, NULL,
  +                                           c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_immortal_create("\">", sizeof("\">") - 1);
  +        tmp2_buck = apr_bucket_immortal_create("\">", sizeof("\">") - 1,
  +                                               c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_heap_create(location, len_loc, 1);
  +        tmp2_buck = apr_bucket_heap_create(location, len_loc, NULL,
  +                                           c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_immortal_create("</A>", sizeof("</A>") - 1);
  +        tmp2_buck = apr_bucket_immortal_create("</A>", sizeof("</A>") - 1,
  +                                               c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
   
           if (*inserted_head == NULL) {
  @@ -890,8 +898,8 @@
           return HTTP_INTERNAL_SERVER_ERROR;
       }
   
  -    bcgi = apr_brigade_create(r->pool);
  -    b = apr_bucket_pipe_create(script_in);
  +    bcgi = apr_brigade_create(r->pool, f->c->bucket_alloc);
  +    b = apr_bucket_pipe_create(script_in, f->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bcgi, b);
       ap_pass_brigade(f->next, bcgi);
   
  
  
  
  1.124     +20 -13    httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -d -u -r1.123 -r1.124
  --- mod_cgid.c	22 Mar 2002 02:56:56 -0000	1.123
  +++ mod_cgid.c	29 Mar 2002 08:17:22 -0000	1.124
  @@ -975,6 +975,7 @@
    */ 
   static int cgid_handler(request_rec *r) 
   { 
  +    conn_rec *c = r->connection;
       int retval, nph, dbpos = 0; 
       char *argv0, *dbuf = NULL; 
       apr_bucket_brigade *bb;
  @@ -1156,10 +1157,10 @@
                */
               apr_pool_cleanup_kill(r->pool, (void *)sd, close_unix_socket);
   
  -            bb = apr_brigade_create(r->pool);
  -            b = apr_bucket_pipe_create(tempsock);
  +            bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +            b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, b);
  -            b = apr_bucket_eos_create();
  +            b = apr_bucket_eos_create(c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, b);
               ap_pass_brigade(r->output_filters, bb);
           } 
  @@ -1185,10 +1186,10 @@
           }
           r->output_filters = r->proto_output_filters = cur;
   
  -        bb = apr_brigade_create(r->pool);
  -        b = apr_bucket_pipe_create(tempsock);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        b = apr_bucket_pipe_create(tempsock, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
  -        b = apr_bucket_eos_create();
  +        b = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           ap_pass_brigade(r->output_filters, bb);
       } 
  @@ -1244,6 +1245,7 @@
       if (ap_is_HTTP_REDIRECT(rr_status)) {
           apr_size_t len_loc;
           const char *location = apr_table_get(rr->headers_out, "Location");
  +        conn_rec *c = r->connection;
   
           location = ap_escape_html(rr->pool, location);
           len_loc = strlen(location);
  @@ -1253,15 +1255,20 @@
            * and a single pool bucket */
   
           tmp_buck = apr_bucket_immortal_create("<A HREF=\"",
  -                                              sizeof("<A HREF=\"") - 1);
  +                                              sizeof("<A HREF=\"") - 1,
  +                                              c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp_buck);
  -        tmp2_buck = apr_bucket_heap_create(location, len_loc, 1);
  +        tmp2_buck = apr_bucket_heap_create(location, len_loc, NULL,
  +                                           c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_immortal_create("\">", sizeof("\">") - 1);
  +        tmp2_buck = apr_bucket_immortal_create("\">", sizeof("\">") - 1,
  +                                               c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_heap_create(location, len_loc, 1);
  +        tmp2_buck = apr_bucket_heap_create(location, len_loc, NULL,
  +                                           c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
  -        tmp2_buck = apr_bucket_immortal_create("</A>", sizeof("</A>") - 1);
  +        tmp2_buck = apr_bucket_immortal_create("</A>", sizeof("</A>") - 1,
  +                                               c->bucket_alloc);
           APR_BUCKET_INSERT_BEFORE(head_ptr, tmp2_buck);
   
           if (*inserted_head == NULL) {
  @@ -1381,8 +1388,8 @@
            */
           apr_pool_cleanup_kill(r->pool, (void *)sd, close_unix_socket);
   
  -        bcgi = apr_brigade_create(r->pool);
  -        b    = apr_bucket_pipe_create(tempsock);
  +        bcgi = apr_brigade_create(r->pool, r->connection->bucket_alloc);
  +        b    = apr_bucket_pipe_create(tempsock, r->connection->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bcgi, b);
           ap_pass_brigade(f->next, bcgi);
       } 
  
  
  
  1.301     +7 -3      httpd-2.0/modules/http/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_core.c,v
  retrieving revision 1.300
  retrieving revision 1.301
  diff -u -d -u -r1.300 -r1.301
  --- http_core.c	25 Mar 2002 07:20:45 -0000	1.300
  +++ http_core.c	29 Mar 2002 08:17:22 -0000	1.301
  @@ -144,6 +144,7 @@
   {
   #define ASCII_CRLF  "\015\012"
   #define ASCII_ZERO  "\060"
  +    conn_rec *c = f->r->connection;
       apr_bucket_brigade *more;
       apr_bucket *e;
       apr_status_t rv;
  @@ -214,14 +215,15 @@
               hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr),
                                      "%qx" CRLF, (apr_uint64_t)bytes);
               ap_xlate_proto_to_ascii(chunk_hdr, hdr_len);
  -            e = apr_bucket_transient_create(chunk_hdr, hdr_len);
  +            e = apr_bucket_transient_create(chunk_hdr, hdr_len,
  +                                            c->bucket_alloc);
               APR_BRIGADE_INSERT_HEAD(b, e);
   
               /*
                * Insert the end-of-chunk CRLF before an EOS or
                * FLUSH bucket, or appended to the brigade
                */
  -            e = apr_bucket_immortal_create(ASCII_CRLF, 2);
  +            e = apr_bucket_immortal_create(ASCII_CRLF, 2, c->bucket_alloc);
               if (eos != NULL) {
                   APR_BUCKET_INSERT_BEFORE(eos, e);
               }
  @@ -248,7 +250,9 @@
            */
           if (eos != NULL) {
               /* XXX: (2) trailers ... does not yet exist */
  -            e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF /* <trailers> */ ASCII_CRLF, 5);
  +            e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
  +                                           /* <trailers> */
  +                                           ASCII_CRLF, 5, c->bucket_alloc);
               APR_BUCKET_INSERT_BEFORE(eos, e);
           }
   
  
  
  
  1.406     +22 -17    httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.405
  retrieving revision 1.406
  diff -u -d -u -r1.405 -r1.406
  --- http_protocol.c	27 Mar 2002 13:05:14 -0000	1.405
  +++ http_protocol.c	29 Mar 2002 08:17:22 -0000	1.406
  @@ -739,11 +739,12 @@
       }
   
       if (!ctx->remaining) {
  +        conn_rec *c = f->r->connection;
           switch (ctx->state) {
           case BODY_NONE:
               break;
           case BODY_LENGTH:
  -            e = apr_bucket_eos_create();
  +            e = apr_bucket_eos_create(c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(b, e);
               return APR_SUCCESS;
           case BODY_CHUNK:
  @@ -766,7 +767,7 @@
   
                   if (!ctx->remaining) {
                       /* Handle trailers by calling get_mime_headers again! */
  -                    e = apr_bucket_eos_create();
  +                    e = apr_bucket_eos_create(c->bucket_alloc);
                       APR_BRIGADE_INSERT_TAIL(b, e);
                       return APR_SUCCESS;
                   }
  @@ -1164,7 +1165,7 @@
   
       /* Now we recreate the request, and echo it back */
   
  -    b = apr_brigade_create(r->pool);
  +    b = apr_brigade_create(r->pool, r->connection->bucket_alloc);
       apr_brigade_putstrs(b, NULL, NULL, r->the_request, CRLF, NULL);
       h.pool = r->pool;
       h.bb = b;
  @@ -1290,6 +1291,7 @@
   {
       int i;
       request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       const char *clheader;
       const char *protocol;
       apr_bucket *e;
  @@ -1416,7 +1418,7 @@
           apr_table_unset(r->headers_out, "Content-Length");
       }
   
  -    b2 = apr_brigade_create(r->pool);
  +    b2 = apr_brigade_create(r->pool, c->bucket_alloc);
       basic_http_header(r, b2, protocol);
   
       h.pool = r->pool;
  @@ -1575,6 +1577,7 @@
       }
   
       if (r->expecting_100 && r->proto_num >= HTTP_VERSION(1,1)) {
  +        conn_rec *c = r->connection;
           char *tmp;
           apr_bucket *e;
           apr_bucket_brigade *bb;
  @@ -1582,10 +1585,10 @@
           /* sending 100 Continue interim response */
           tmp = apr_pstrcat(r->pool, AP_SERVER_PROTOCOL, " ", status_lines[0],
                             CRLF CRLF, NULL);
  -        bb = apr_brigade_create(r->pool);
  -        e = apr_bucket_pool_create(tmp, strlen(tmp), r->pool);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        e = apr_bucket_pool_create(tmp, strlen(tmp), r->pool, c->bucket_alloc);
           APR_BRIGADE_INSERT_HEAD(bb, e);
  -        e = apr_bucket_flush_create();
  +        e = apr_bucket_flush_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, e);
   
           ap_pass_brigade(r->connection->output_filters, bb);
  @@ -2585,6 +2588,7 @@
   {
   #define MIN_LENGTH(len1, len2) ((len1 > len2) ? len2 : len1)
       request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       byterange_ctx *ctx = f->ctx;
       apr_bucket *e;
       apr_bucket_brigade *bsend;
  @@ -2602,11 +2606,11 @@
   
           if (num_ranges == -1) {
               ap_remove_output_filter(f);
  -            bsend = apr_brigade_create(r->pool);
  +            bsend = apr_brigade_create(r->pool, c->bucket_alloc);
               e = ap_bucket_error_create(HTTP_RANGE_NOT_SATISFIABLE, NULL, 
  -                                       r->pool);
  +                                       r->pool, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bsend, e);
  -            e = apr_bucket_eos_create();
  +            e = apr_bucket_eos_create(c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bsend, e);
               return ap_pass_brigade(f->next, bsend);
           }
  @@ -2627,7 +2631,7 @@
           }
   
           /* create a brigade in case we never call ap_save_brigade() */
  -        ctx->bb = apr_brigade_create(r->pool);
  +        ctx->bb = apr_brigade_create(r->pool, c->bucket_alloc);
       }
   
       /* We can't actually deal with byte-ranges until we have the whole brigade
  @@ -2664,7 +2668,7 @@
       clength = (apr_off_t)bb_length;
   
       /* this brigade holds what we will be sending */
  -    bsend = apr_brigade_create(r->pool);
  +    bsend = apr_brigade_create(r->pool, c->bucket_alloc);
   
       while ((current = ap_getword(r->pool, &r->range, ','))
              && (rv = parse_byterange(current, clength, &range_start,
  @@ -2695,14 +2699,15 @@
           if (ctx->num_ranges > 1) {
               char *ts;
   
  -            e = apr_bucket_pool_create(bound_head,
  -                                      strlen(bound_head), r->pool);
  +            e = apr_bucket_pool_create(bound_head, strlen(bound_head),
  +                                       r->pool, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bsend, e);
   
               ts = apr_psprintf(r->pool, BYTERANGE_FMT CRLF CRLF,
                                 range_start, range_end, clength);
               ap_xlate_proto_to_ascii(ts, strlen(ts));
  -            e = apr_bucket_pool_create(ts, strlen(ts), r->pool);
  +            e = apr_bucket_pool_create(ts, strlen(ts), r->pool,
  +                                       c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bsend, e);
           }
   
  @@ -2739,11 +2744,11 @@
           /* add the final boundary */
           end = apr_pstrcat(r->pool, CRLF "--", r->boundary, "--" CRLF, NULL);
           ap_xlate_proto_to_ascii(end, strlen(end));
  -        e = apr_bucket_pool_create(end, strlen(end), r->pool);
  +        e = apr_bucket_pool_create(end, strlen(end), r->pool, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bsend, e);
       }
   
  -    e = apr_bucket_eos_create();
  +    e = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bsend, e);
   
       /* we're done with the original content */
  
  
  
  1.135     +3 -2      httpd-2.0/modules/http/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
  retrieving revision 1.134
  retrieving revision 1.135
  diff -u -d -u -r1.134 -r1.135
  --- http_request.c	27 Mar 2002 22:42:16 -0000	1.134
  +++ http_request.c	29 Mar 2002 08:17:23 -0000	1.135
  @@ -207,10 +207,11 @@
   
   static void check_pipeline_flush(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       /* ### if would be nice if we could PEEK without a brigade. that would
          ### allow us to defer creation of the brigade to when we actually
          ### need to send a FLUSH. */
  -    apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  +    apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
   
       /* Flush the filter contents if:
        *
  @@ -222,7 +223,7 @@
       if (!r->connection->keepalive || 
           ap_get_brigade(r->input_filters, bb, AP_MODE_EATCRLF, 
                          APR_NONBLOCK_READ, 0) != APR_SUCCESS) {
  -        apr_bucket *e = apr_bucket_flush_create();
  +        apr_bucket *e = apr_bucket_flush_create(c->bucket_alloc);
   
           /* We just send directly to the connection based filters.  At
            * this point, we know that we have seen all of the data
  
  
  
  1.101     +5 -3      httpd-2.0/modules/mappers/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_negotiation.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -d -u -r1.100 -r1.101
  --- mod_negotiation.c	20 Mar 2002 17:41:55 -0000	1.100
  +++ mod_negotiation.c	29 Mar 2002 08:17:23 -0000	1.101
  @@ -2813,6 +2813,7 @@
   
       if (best->body)
       {
  +        conn_rec *c = r->connection;
           apr_bucket_brigade *bb;
           apr_bucket *e;
   
  @@ -2840,11 +2841,12 @@
               return res;
           }
   
  -        bb = apr_brigade_create(r->pool);
  +        bb = apr_brigade_create(r->pool, c->bucket_alloc);
           e = apr_bucket_file_create(map, best->body, 
  -                                   (apr_size_t)best->bytes, r->pool);
  +                                   (apr_size_t)best->bytes, r->pool,
  +                                   c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, e);
  -        e = apr_bucket_eos_create();
  +        e = apr_bucket_eos_create(c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, e);
   
           return ap_pass_brigade(r->output_filters, bb);
  
  
  
  1.117     +33 -21    httpd-2.0/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -d -u -r1.116 -r1.117
  --- proxy_ftp.c	20 Mar 2002 17:41:55 -0000	1.116
  +++ proxy_ftp.c	29 Mar 2002 08:17:23 -0000	1.117
  @@ -315,8 +315,9 @@
   apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *in)
   {
       request_rec *r = f->r;
  +    conn_rec *c = r->connection;
       apr_pool_t *p = r->pool;
  -    apr_bucket_brigade *out = apr_brigade_create(p);
  +    apr_bucket_brigade *out = apr_brigade_create(p, c->bucket_alloc);
       apr_status_t rv;
   
       register int n;
  @@ -329,7 +330,7 @@
   
       if (!ctx) {
           f->ctx = ctx = apr_pcalloc(p, sizeof(*ctx));
  -        ctx->in = apr_brigade_create(p);
  +        ctx->in = apr_brigade_create(p, c->bucket_alloc);
           ctx->buffer[0] = 0;
           ctx->state = HEADER;
       }
  @@ -387,7 +388,8 @@
                   site, basedir, ap_escape_uri(p, path),
                   site, str);
   
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str),
  +                                                          p, c->bucket_alloc));
   
           for (dir = path+1; (dir = strchr(dir, '/')) != NULL; )
           {
  @@ -404,10 +406,14 @@
               *dir = '/';
               while (*dir == '/')
                 ++dir;
  -            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  +            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str,
  +                                                           strlen(str), p,
  +                                                           c->bucket_alloc));
           }
           if (wildcard != NULL) {
  -            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(wildcard, strlen(wildcard), p));
  +            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(wildcard,
  +                                                           strlen(wildcard), p,
  +                                                           c->bucket_alloc));
           }
   
           /* If the caller has determined the current directory, and it differs */
  @@ -419,18 +425,21 @@
               str = apr_psprintf(p, "</h2>\n\n(%s)\n\n  <hr />\n\n<pre>",
                                  ap_escape_html(p, pwd));
           }
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str),
  +                                                           p, c->bucket_alloc));
   
           /* print README */
           if (readme) {
               str = apr_psprintf(p, "%s\n</pre>\n\n<hr />\n\n<pre>\n",
                                  ap_escape_html(p, readme));
   
  -            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  +            APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str,
  +                                                           strlen(str), p,
  +                                                           c->bucket_alloc));
           }
   
           /* make sure page intro gets sent out */
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create());
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create(c->bucket_alloc));
           if (APR_SUCCESS != (rv = ap_pass_brigade(f->next, out))) {
               return rv;
           }
  @@ -581,8 +590,9 @@
           /* erase buffer for next time around */
           ctx->buffer[0] = 0;
   
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create());
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p,
  +                                                            c->bucket_alloc));
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create(c->bucket_alloc));
           if (APR_SUCCESS != (rv = ap_pass_brigade(f->next, out))) {
               return rv;
           }
  @@ -592,9 +602,10 @@
   
       if (FOOTER == ctx->state) {
           str = apr_psprintf(p, "</pre>\n\n  <hr />\n\n  %s\n\n </body>\n</html>\n", ap_psignature("", r));
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p));
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create());
  -        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_eos_create());
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_pool_create(str, strlen(str), p,
  +                                                            c->bucket_alloc));
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_flush_create(c->bucket_alloc));
  +        APR_BRIGADE_INSERT_TAIL(out, apr_bucket_eos_create(c->bucket_alloc));
           if (APR_SUCCESS != (rv = ap_pass_brigade(f->next, out))) {
               return rv;
           }
  @@ -619,9 +630,9 @@
   
       /* If cmd == NULL, we retrieve the next ftp response line */
       if (cmd != NULL) {
  -
  -        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_pool_create(cmd, strlen(cmd), r->pool));
  -        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create());
  +        conn_rec *c = r->connection;
  +        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_pool_create(cmd, strlen(cmd), r->pool, c->bucket_alloc));
  +        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(c->bucket_alloc));
           ap_pass_brigade(ftp_ctrl->output_filters, bb);
   
           /* strip off the CRLF for logging */
  @@ -768,7 +779,7 @@
       apr_status_t rv;
       conn_rec *origin, *data = NULL;
       int err;
  -    apr_bucket_brigade *bb = apr_brigade_create(p);
  +    apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc);
       char *buf, *connectname;
       apr_port_t connectport;
       char buffer[MAX_STRING_LEN];
  @@ -1013,7 +1024,8 @@
       }
   
       /* the socket is now open, create a new connection */
  -    origin = ap_run_create_connection(p, r->server, sock, r->connection->id, r->connection->sbh);
  +    origin = ap_run_create_connection(p, r->server, sock, r->connection->id,
  +                                      r->connection->sbh, c->bucket_alloc);
       if (!origin) {
           /*
            * the peer reset the connection already; ap_run_create_connection() closed
  @@ -1084,7 +1096,6 @@
           return ap_proxyerror(r, HTTP_BAD_GATEWAY, ftpmessage);
       }
   
  -
       rc = proxy_ftp_command(apr_pstrcat(p, "USER ", user, CRLF, NULL),
                              r, origin, bb, &ftpmessage);
       /* possible results; 230, 331, 332, 421, 500, 501, 530 */
  @@ -1774,7 +1785,8 @@
       }
   
       /* the transfer socket is now open, create a new connection */
  -    data = ap_run_create_connection(p, r->server, data_sock, r->connection->id, r->connection->sbh);
  +    data = ap_run_create_connection(p, r->server, data_sock, r->connection->id,
  +                                    r->connection->sbh, c->bucket_alloc);
       if (!data) {
           /*
            * the peer reset the connection already; ap_run_create_connection() closed
  @@ -1849,7 +1861,7 @@
   
               /* if no EOS yet, then we must flush */
               if (FALSE == finish) {
  -                e = apr_bucket_flush_create();
  +                e = apr_bucket_flush_create(c->bucket_alloc);
                   APR_BRIGADE_INSERT_TAIL(bb, e);
               }
   
  
  
  
  1.140     +14 -11    httpd-2.0/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -d -u -r1.139 -r1.140
  --- proxy_http.c	29 Mar 2002 07:29:11 -0000	1.139
  +++ proxy_http.c	29 Mar 2002 08:17:23 -0000	1.140
  @@ -375,7 +375,8 @@
   
           /* the socket is now open, create a new backend server connection */
           *origin = ap_run_create_connection(c->pool, r->server, p_conn->sock,
  -                                           r->connection->id, r->connection->sbh);
  +                                           r->connection->id,
  +                                           r->connection->sbh, c->bucket_alloc);
           if (!origin) {
           /* the peer reset the connection already; ap_run_create_connection() 
            * closed the socket
  @@ -412,6 +413,7 @@
                                      apr_uri_t *uri,
                                      char *url, apr_bucket_brigade *bb,
                                      char *server_portstr) {
  +    conn_rec *c = r->connection;
       char buffer[HUGE_STRING_LEN];
       char *buf;
       apr_bucket *e;
  @@ -442,7 +444,7 @@
       }
   
       buf = apr_pstrcat(p, r->method, " ", url, " HTTP/1.1" CRLF, NULL);
  -    e = apr_bucket_pool_create(buf, strlen(buf), p);
  +    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, e);
       if ( conf->preserve_host == 0 ) {
           if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) {
  @@ -468,7 +470,7 @@
           }
           buf = apr_pstrcat(p, "Host: ", hostname, CRLF, NULL);
       }
  -    e = apr_bucket_pool_create(buf, strlen(buf), p);        
  +    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);        
       APR_BRIGADE_INSERT_TAIL(bb, e);
   
       /* handle Via */
  @@ -583,14 +585,14 @@
           buf = apr_pstrcat(p, headers_in[counter].key, ": ",
                             headers_in[counter].val, CRLF,
                             NULL);
  -        e = apr_bucket_pool_create(buf, strlen(buf), p);
  +        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, e);
       }
   
       /* add empty line at the end of the headers */
  -    e = apr_bucket_immortal_create(CRLF, sizeof(CRLF)-1);
  +    e = apr_bucket_immortal_create(CRLF, sizeof(CRLF)-1, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, e);
  -    e = apr_bucket_flush_create();
  +    e = apr_bucket_flush_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, e);
   
       ap_pass_brigade(origin->output_filters, bb);
  @@ -598,9 +600,9 @@
       /* send the request data, if any. */
       if (ap_should_client_block(r)) {
           while ((counter = ap_get_client_block(r, buffer, sizeof(buffer))) > 0) {
  -            e = apr_bucket_pool_create(buffer, counter, p);
  +            e = apr_bucket_pool_create(buffer, counter, p, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, e);
  -            e = apr_bucket_flush_create();
  +            e = apr_bucket_flush_create(c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, e);
               ap_pass_brigade(origin->output_filters, bb);
               apr_brigade_cleanup(bb);
  @@ -617,6 +619,7 @@
                                               proxy_server_conf *conf,
                                               apr_bucket_brigade *bb,
                                               char *server_portstr) {
  +    conn_rec *c = r->connection;
       char buffer[HUGE_STRING_LEN];
       request_rec *rp;
       apr_bucket *e;
  @@ -789,7 +792,7 @@
           /* Is it an HTTP/0.9 response? If so, send the extra data */
           if (backasswards) {
               apr_ssize_t cntr = len;
  -            e = apr_bucket_heap_create(buffer, cntr, 1);
  +            e = apr_bucket_heap_create(buffer, cntr, NULL, c->bucket_alloc);
               APR_BRIGADE_INSERT_TAIL(bb, e);
           }
   
  @@ -859,7 +862,7 @@
   
                       /* if no EOS yet, then we must flush */
                       if (FALSE == finish) {
  -                        e = apr_bucket_flush_create();
  +                        e = apr_bucket_flush_create(c->bucket_alloc);
                           APR_BRIGADE_INSERT_TAIL(bb, e);
                       }
   
  @@ -958,7 +961,7 @@
        */
       apr_pool_t *p = r->connection->pool;
       conn_rec *c = r->connection;
  -    apr_bucket_brigade *bb = apr_brigade_create(p);
  +    apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc);
       apr_uri_t *uri = apr_palloc(r->connection->pool, sizeof(*uri));
       proxy_http_conn_t *p_conn = apr_pcalloc(r->connection->pool,
                                              sizeof(*p_conn));
  
  
  
  1.68      +15 -12    httpd-2.0/modules/ssl/ssl_engine_io.c
  
  Index: ssl_engine_io.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -d -u -r1.67 -r1.68
  --- ssl_engine_io.c	29 Mar 2002 07:23:09 -0000	1.67
  +++ ssl_engine_io.c	29 Mar 2002 08:17:24 -0000	1.68
  @@ -99,7 +99,7 @@
   
       b->frec = frec;
       b->c = c;
  -    b->bb = apr_brigade_create(c->pool);
  +    b->bb = apr_brigade_create(c->pool, c->bucket_alloc);
       b->blen = 0;
       b->length = 0;
   
  @@ -111,24 +111,25 @@
   static int BIO_bucket_flush(BIO *bio)
   {
       BIO_bucket_t *b = BIO_bucket_ptr(bio);
  +    apr_bucket *e;
   
       if (!(b->blen || b->length)) {
           return APR_SUCCESS;
       }
   
       if (b->blen) {
  -        apr_bucket *bucket = 
  -            apr_bucket_transient_create(b->buffer,
  -                                        b->blen);
  +        e = apr_bucket_transient_create(b->buffer, b->blen,
  +                                        b->bb->bucket_alloc);
           /* we filled this buffer first so add it to the 
            * head of the brigade
            */
  -        APR_BRIGADE_INSERT_HEAD(b->bb, bucket);
  +        APR_BRIGADE_INSERT_HEAD(b->bb, e);
           b->blen = 0;
       }
   
       b->length = 0;
  -    APR_BRIGADE_INSERT_TAIL(b->bb, apr_bucket_flush_create());
  +    e = apr_bucket_flush_create(b->bb->bucket_alloc);
  +    APR_BRIGADE_INSERT_TAIL(b->bb, e);
   
       return ap_pass_brigade(b->frec->pOutputFilter->next, b->bb);
   }
  @@ -187,7 +188,8 @@
            * need to flush since we're using SSL's malloc-ed buffer 
            * which will be overwritten once we leave here
            */
  -        apr_bucket *bucket = apr_bucket_transient_create(in, inl);
  +        apr_bucket *bucket = apr_bucket_transient_create(in, inl,
  +                                                         b->bb->bucket_alloc);
   
           b->length += inl;
           APR_BRIGADE_INSERT_TAIL(b->bb, bucket);
  @@ -732,9 +734,10 @@
   #define HTTP_ON_HTTPS_PORT \
       "GET /mod_ssl:error:HTTP-request HTTP/1.0\r\n\r\n"
   
  -#define HTTP_ON_HTTPS_PORT_BUCKET() \
  +#define HTTP_ON_HTTPS_PORT_BUCKET(alloc) \
       apr_bucket_immortal_create(HTTP_ON_HTTPS_PORT, \
  -                               sizeof(HTTP_ON_HTTPS_PORT) - 1)
  +                               sizeof(HTTP_ON_HTTPS_PORT) - 1, \
  +                               alloc)
   
   static apr_status_t ssl_io_filter_error(ap_filter_t *f,
                                           apr_bucket_brigade *bb,
  @@ -750,7 +753,7 @@
                       "trying to send HTML error page");
   
               /* fake the request line */
  -            bucket = HTTP_ON_HTTPS_PORT_BUCKET();
  +            bucket = HTTP_ON_HTTPS_PORT_BUCKET(f->c->bucket_alloc);
               break;
   
         default:
  @@ -824,7 +827,7 @@
   
       if (len > 0) {
           apr_bucket *bucket =
  -            apr_bucket_transient_create(ctx->buffer, len);
  +            apr_bucket_transient_create(ctx->buffer, len, f->c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, bucket);
       }
   
  @@ -847,7 +850,7 @@
       ctx->inbio.ssl = ssl;
       ctx->inbio.wbio = frec->pbioWrite;
       ctx->inbio.f = frec->pInputFilter;
  -    ctx->inbio.bb = apr_brigade_create(c->pool);
  +    ctx->inbio.bb = apr_brigade_create(c->pool, c->bucket_alloc);
       ctx->inbio.bucket = NULL;
       ctx->inbio.cbuf.length = 0;
   
  
  
  
  1.8       +9 -5      httpd-2.0/modules/test/mod_bucketeer.c
  
  Index: mod_bucketeer.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/test/mod_bucketeer.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -d -u -r1.7 -r1.8
  --- mod_bucketeer.c	13 Mar 2002 20:47:57 -0000	1.7
  +++ mod_bucketeer.c	29 Mar 2002 08:17:24 -0000	1.8
  @@ -122,7 +122,7 @@
   
           /* We're cool with filtering this. */
           ctx = f->ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
  -        ctx->bb = apr_brigade_create(f->r->pool); 
  +        ctx->bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc); 
           apr_table_unset(f->r->headers_out, "Content-Length");
       }
   
  @@ -163,13 +163,13 @@
                           p = apr_bucket_pool_create(apr_pmemdup( f->r->pool,
                                                               &data[lastpos],
                                                               i-lastpos),
  -                                                    i-lastpos,
  -                                                    f->r->pool);
  +                                                    i-lastpos, f->r->pool,
  +                                                    f->c->bucket_alloc);
                           APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
                       }
                       lastpos=i+1;
                       if ( data[i] == c->flushdelimiter) {
  -                        p = apr_bucket_flush_create();
  +                        p = apr_bucket_flush_create(f->c->bucket_alloc);
                           APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
                       }
                       if ( data[i] == c->flushdelimiter || data[i] == c->passdelimiter ) {
  @@ -181,7 +181,11 @@
               /* XXX: really should append this to the next 'real' bucket */
               if ( lastpos < i ) {
                   apr_bucket *p;
  -                p = apr_bucket_pool_create(apr_pmemdup( f->r->pool,&data[lastpos],i-lastpos),i-lastpos,f->r->pool);
  +                p = apr_bucket_pool_create(apr_pmemdup(f->r->pool,
  +                                                       &data[lastpos],
  +                                                       i-lastpos),
  +                                           i-lastpos, f->r->pool,
  +                                           f->c->bucket_alloc);
                   lastpos=i;
                   APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
               }
  
  
  
  1.104     +4 -4      httpd-2.0/server/connection.c
  
  Index: connection.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/connection.c,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -d -u -r1.103 -r1.104
  --- connection.c	19 Mar 2002 19:01:50 -0000	1.103
  +++ connection.c	29 Mar 2002 08:17:24 -0000	1.104
  @@ -80,8 +80,8 @@
   	    APR_HOOK_LINK(pre_connection)
   )
   AP_IMPLEMENT_HOOK_RUN_FIRST(conn_rec *,create_connection,
  -                            (apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh),
  -                            (p, server, csd, conn_id, sbh), NULL)
  +                            (apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh, apr_bucket_alloc_t *alloc),
  +                            (p, server, csd, conn_id, sbh, alloc), NULL)
   AP_IMPLEMENT_HOOK_RUN_FIRST(int,process_connection,(conn_rec *c),(c),DECLINED)
   AP_IMPLEMENT_HOOK_RUN_ALL(int,pre_connection,(conn_rec *c, void *csd),(c, csd),OK,DECLINED)
   /*
  @@ -113,8 +113,8 @@
       apr_bucket_brigade *bb;
       apr_bucket *b;
   
  -    bb = apr_brigade_create(c->pool);
  -    b = apr_bucket_flush_create();
  +    bb = apr_brigade_create(c->pool, c->bucket_alloc);
  +    b = apr_bucket_flush_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       ap_pass_brigade(c->output_filters, bb);
   }
  
  
  
  1.168     +20 -12    httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.167
  retrieving revision 1.168
  diff -u -d -u -r1.167 -r1.168
  --- core.c	22 Mar 2002 21:45:44 -0000	1.167
  +++ core.c	29 Mar 2002 08:17:24 -0000	1.168
  @@ -3122,6 +3122,7 @@
   
   static int default_handler(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *e;
       core_dir_config *d;
  @@ -3215,7 +3216,7 @@
                          ap_md5digest(r->pool, fd));
       }
   
  -    bb = apr_brigade_create(r->pool);
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
   #if APR_HAS_LARGE_FILES
       if (r->finfo.size > AP_MAX_SENDFILE) {
           /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
  @@ -3223,7 +3224,8 @@
            * in case the brigade code/filters attempt to read it directly.
            */
           apr_off_t fsize = r->finfo.size;
  -        e = apr_bucket_file_create(fd, 0, AP_MAX_SENDFILE, r->pool);
  +        e = apr_bucket_file_create(fd, 0, AP_MAX_SENDFILE, r->pool,
  +                                   c->bucket_alloc);
           while (fsize > AP_MAX_SENDFILE) {
               apr_bucket *ce;
               apr_bucket_copy(e, &ce);
  @@ -3235,10 +3237,11 @@
       }
       else
   #endif
  -        e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size, r->pool);
  +        e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size,
  +                                   r->pool, c->bucket_alloc);
   
       APR_BRIGADE_INSERT_TAIL(bb, e);
  -    e = apr_bucket_eos_create();
  +    e = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, e);
   
       return ap_pass_brigade(r->output_filters, bb);
  @@ -3320,10 +3323,10 @@
       if (!ctx)
       {
           ctx = apr_pcalloc(f->c->pool, sizeof(*ctx));
  -        ctx->b = apr_brigade_create(f->c->pool);
  +        ctx->b = apr_brigade_create(f->c->pool, f->c->bucket_alloc);
   
           /* seed the brigade with the client socket. */
  -        e = apr_bucket_socket_create(net->client_socket);
  +        e = apr_bucket_socket_create(net->client_socket, f->c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(ctx->b, e);
           net->in_ctx = ctx;
       }
  @@ -3410,7 +3413,7 @@
            * so tack on an EOS too. */
           /* We have read until the brigade was empty, so we know that we
            * must be EOS. */
  -        e = apr_bucket_eos_create();
  +        e = apr_bucket_eos_create(f->c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(b, e);
           return APR_SUCCESS;
       }
  @@ -3444,7 +3447,7 @@
               apr_bucket_delete(e);
   
               if (mode == AP_MODE_READBYTES) {
  -                e = apr_bucket_eos_create();
  +                e = apr_bucket_eos_create(f->c->bucket_alloc);
                   APR_BRIGADE_INSERT_TAIL(b, e);
               }
               return APR_SUCCESS;
  @@ -3618,7 +3621,8 @@
                                   b = bb;
                               }
                               else {
  -                                temp_brig = apr_brigade_create(f->c->pool);
  +                                temp_brig = apr_brigade_create(f->c->pool,
  +                                                           f->c->bucket_alloc);
                               }
   
                               temp = APR_BRIGADE_FIRST(b);
  @@ -3722,7 +3726,8 @@
                    * after the request_pool is cleared.
                    */
                   if (ctx->b == NULL) {
  -                    ctx->b = apr_brigade_create(net->c->pool);
  +                    ctx->b = apr_brigade_create(net->c->pool,
  +                                                net->c->bucket_alloc);
                   }
   
                   APR_BRIGADE_FOREACH(bucket, b) {
  @@ -3925,7 +3930,7 @@
           req_cfg->bb = main_req_cfg->bb;
       }
       else {
  -        req_cfg->bb = apr_brigade_create(r->pool);
  +        req_cfg->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
           if (!r->prev) {
               ap_add_input_filter_handle(ap_net_time_filter_handle,
                                          NULL, r, r->connection);
  @@ -3948,7 +3953,8 @@
   }
   
   static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
  -                                  apr_socket_t *csd, long id, void *sbh)
  +                                  apr_socket_t *csd, long id, void *sbh,
  +                                  apr_bucket_alloc_t *alloc)
   {
       apr_status_t rv;
       conn_rec *c = (conn_rec *) apr_pcalloc(ptrans, sizeof(conn_rec));
  @@ -3984,6 +3990,8 @@
       c->base_server = server;
   
       c->id = id;
  +    c->bucket_alloc = alloc;
  +
       return c;
   }
   
  
  
  
  1.12      +8 -10     httpd-2.0/server/error_bucket.c
  
  Index: error_bucket.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/error_bucket.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -d -u -r1.11 -r1.12
  --- error_bucket.c	13 Mar 2002 20:48:00 -0000	1.11
  +++ error_bucket.c	29 Mar 2002 08:17:24 -0000	1.12
  @@ -55,7 +55,6 @@
   #include "http_protocol.h"
   #include "apr_buckets.h"
   #include "apr_strings.h"
  -#include <stdlib.h>
   #if APR_HAVE_STRINGS_H
   #include <strings.h>
   #endif
  @@ -73,10 +72,7 @@
   {
       ap_bucket_error *h;
   
  -    h = malloc(sizeof(*h));
  -    if (h == NULL) {
  -        return NULL;
  -    }
  +    h = apr_bucket_alloc(sizeof(*h), b->list);
       h->status = error;
       h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
   
  @@ -87,19 +83,21 @@
       return b;
   }
   
  -AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, 
  -		const char *buf, apr_pool_t *p)
  +AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error, const char *buf,
  +                                                apr_pool_t *p,
  +                                                apr_bucket_alloc_t *list)
   {
  -    apr_bucket *b = (apr_bucket *)malloc(sizeof(*b));
  +    apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
   
       APR_BUCKET_INIT(b);
  -    b->free = free;
  +    b->free = apr_bucket_free;
  +    b->list = list;
       return ap_bucket_error_make(b, error, buf, p);
   }
   
   AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_error = {
       "ERROR", 5,
  -    free,
  +    apr_bucket_free,
       error_read,
       apr_bucket_setaside_notimpl,
       apr_bucket_split_notimpl,
  
  
  
  1.94      +18 -13    httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -d -u -r1.93 -r1.94
  --- protocol.c	17 Mar 2002 23:18:10 -0000	1.93
  +++ protocol.c	29 Mar 2002 08:17:24 -0000	1.94
  @@ -217,7 +217,7 @@
       char *pos, *last_char = *s;
       int do_alloc = (*s == NULL), saw_eos = 0;
   
  -    b = apr_brigade_create(r->pool);
  +    b = apr_brigade_create(r->pool, r->connection->bucket_alloc);
       rv = ap_get_brigade(r->input_filters, b, AP_MODE_GETLINE,
                           APR_BLOCK_READ, 0);
   
  @@ -405,7 +405,7 @@
           char c;
   
           /* Create a brigade for this filter read. */
  -        bb = apr_brigade_create(r->pool);
  +        bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
   
           /* We only care about the first byte. */
           rv = ap_get_brigade(r->input_filters, bb, AP_MODE_SPECULATIVE,
  @@ -984,11 +984,12 @@
   
   static void end_output_stream(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *b;
   
  -    bb = apr_brigade_create(r->pool);
  -    b = apr_bucket_eos_create();
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_eos_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       ap_pass_brigade(r->output_filters, bb);
   }
  @@ -1269,12 +1270,13 @@
                                       apr_off_t offset, apr_size_t len,
                                       apr_size_t *nbytes)
   {
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb = NULL;
       apr_bucket *b;
       apr_status_t rv;
   
  -    bb = apr_brigade_create(r->pool);
  -    b = apr_bucket_file_create(fd, offset, len, r->pool);
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_file_create(fd, offset, len, r->pool, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
   
       rv = ap_pass_brigade(r->output_filters, bb);
  @@ -1293,11 +1295,12 @@
   AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
                                   size_t length)
   {
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb = NULL;
       apr_bucket *b;
   
  -    bb = apr_brigade_create(r->pool);
  -    b = apr_bucket_mmap_create(mm, offset, length);
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_mmap_create(mm, offset, length, c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       ap_pass_brigade(r->output_filters, bb);
   
  @@ -1332,6 +1335,7 @@
   static apr_status_t buffer_output(request_rec *r,
                                     const char *str, apr_size_t len)
   {
  +    conn_rec *c = r->connection;
       ap_filter_t *f;
       old_write_filter_ctx *ctx;
   
  @@ -1359,8 +1363,8 @@
        * deliver the content through the normal filter chain
        */
       if (f != r->output_filters) {
  -        apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  -        apr_bucket *b = apr_bucket_transient_create(str, len);
  +        apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +        apr_bucket *b = apr_bucket_transient_create(str, len, c->bucket_alloc);
           APR_BRIGADE_INSERT_TAIL(bb, b);
   
           return ap_pass_brigade(r->output_filters, bb);
  @@ -1370,7 +1374,7 @@
       ctx = r->output_filters->ctx;
   
       if (ctx->bb == NULL) {
  -        ctx->bb = apr_brigade_create(r->pool);
  +        ctx->bb = apr_brigade_create(r->pool, c->bucket_alloc);
       }
   
       return ap_fwrite(f->next, ctx->bb, str, len);
  @@ -1525,11 +1529,12 @@
   
   AP_DECLARE(int) ap_rflush(request_rec *r)
   {
  +    conn_rec *c = r->connection;
       apr_bucket_brigade *bb;
       apr_bucket *b;
   
  -    bb = apr_brigade_create(r->pool);
  -    b = apr_bucket_flush_create();
  +    bb = apr_brigade_create(r->pool, c->bucket_alloc);
  +    b = apr_bucket_flush_create(c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
           return -1;
  
  
  
  1.90      +2 -2      httpd-2.0/server/util_filter.c
  
  Index: util_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util_filter.c,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -d -u -r1.89 -r1.90
  --- util_filter.c	13 Mar 2002 20:48:01 -0000	1.89
  +++ util_filter.c	29 Mar 2002 08:17:24 -0000	1.90
  @@ -547,7 +547,7 @@
        * create an empty bucket brigade so that we can concat.
        */
       if (!(*saveto)) {
  -        *saveto = apr_brigade_create(p);
  +        *saveto = apr_brigade_create(p, f->c->bucket_alloc);
       }
       
       APR_RING_FOREACH(e, &(*b)->list, apr_bucket, link) {
  @@ -575,7 +575,7 @@
   {
       apr_bucket *b;
   
  -    b = apr_bucket_flush_create();
  +    b = apr_bucket_flush_create(f->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       return ap_pass_brigade(f, bb);
   }
  
  
  
  1.91      +8 -2      httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -d -u -r1.90 -r1.91
  --- beos.c	20 Mar 2002 20:38:52 -0000	1.90
  +++ beos.c	29 Mar 2002 08:17:25 -0000	1.91
  @@ -324,7 +324,8 @@
    * Child process main loop.
    */
   
  -static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num)
  +static void process_socket(apr_pool_t *p, apr_socket_t *sock,
  +                           int my_child_num, apr_bucket_alloc_t *bucket_alloc)
   {
       conn_rec *current_conn;
       long conn_id = my_child_num;
  @@ -359,6 +360,7 @@
       apr_allocator_t *allocator;
       apr_socket_t *csd = NULL;
       apr_pool_t *ptrans;		/* Pool for per-transaction stuff */
  +    apr_bucket_alloc_t *bucket_alloc;
       apr_socket_t *sd = NULL;
       apr_status_t rv = APR_EINIT;
       int srv , n;
  @@ -393,6 +395,8 @@
       for(n=0 ; n <= num_listening_sockets ; n++)
           apr_poll_socket_add(pollset, listening_sockets[n], APR_POLLIN);
   
  +    bucket_alloc = apr_bucket_alloc_create(tpool);
  +
       while (1) {
           /* If we're here, then chances are (unless we're the first thread created) 
            * we're going to be held up in the accept mutex, so doing this here
  @@ -480,7 +484,7 @@
                   ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
                     "apr_accept");
               } else {
  -                process_socket(ptrans, csd, child_slot);
  +                process_socket(ptrans, csd, child_slot, bucket_alloc);
                   requests_this_child--;
               }
           }
  @@ -492,6 +496,8 @@
       }
   
       ap_update_child_status_from_indexes(0, child_slot, SERVER_DEAD, (request_rec*)NULL);
  +
  +    apr_bucket_alloc_destroy(bucket_alloc);
   
   ap_log_error(APLOG_MARK, APLOG_NOTICE | APLOG_NOERRNO, 0, NULL,
                "worker_thread %ld exiting", find_thread(NULL));
  
  
  
  1.18      +6 -1      httpd-2.0/server/mpm/mpmt_os2/mpmt_os2_child.c
  
  Index: mpmt_os2_child.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_os2/mpmt_os2_child.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -d -u -r1.17 -r1.18
  --- mpmt_os2_child.c	13 Mar 2002 20:48:03 -0000	1.17
  +++ mpmt_os2_child.c	29 Mar 2002 08:17:25 -0000	1.18
  @@ -400,6 +400,7 @@
       long conn_id;
       conn_rec *current_conn;
       apr_pool_t *pconn;
  +    apr_bucket_alloc_t *bucket_alloc;
       worker_args_t *worker_args;
       HQUEUE workq;
       PID owner;
  @@ -430,14 +431,18 @@
       while (rc = DosReadQueue(workq, &rd, &len, (PPVOID)&worker_args, 0, DCWW_WAIT, &priority, NULLHANDLE),
              rc == 0 && rd.ulData != WORKTYPE_EXIT) {
           pconn = worker_args->pconn;
  +        bucket_alloc = apr_bucket_alloc_create(pconn);
           ap_create_sb_handle(&sbh, pconn, child_slot, thread_slot);
  -        current_conn = ap_run_create_connection(pconn, ap_server_conf, worker_args->conn_sd, conn_id, sbh);
  +        current_conn = ap_run_create_connection(pconn, ap_server_conf,
  +                                                worker_args->conn_sd, conn_id,
  +                                                sbh, bucket_alloc);
   
           if (current_conn) {
               ap_process_connection(current_conn, worker_args->conn_sd);
               ap_lingering_close(current_conn);
           }
   
  +        apr_bucket_alloc_destroy(bucket_alloc);
           apr_pool_destroy(pconn);
           ap_update_child_status_from_indexes(child_slot, thread_slot, 
                                               SERVER_READY, NULL);
  
  
  
  1.41      +5 -1      httpd-2.0/server/mpm/netware/mpm_netware.c
  
  Index: mpm_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/netware/mpm_netware.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -d -u -r1.40 -r1.41
  --- mpm_netware.c	20 Mar 2002 22:19:11 -0000	1.40
  +++ mpm_netware.c	29 Mar 2002 08:17:25 -0000	1.41
  @@ -353,6 +353,7 @@
       ap_listen_rec *last_lr = NULL;
       apr_pool_t *ptrans;
       apr_allocator_t *allocator;
  +    apr_bucket_alloc_t *bucket_alloc;
       conn_rec *current_conn;
       apr_status_t stat = APR_EINIT;
       int worker_num_arg = (int)arg;
  @@ -374,6 +375,8 @@
       apr_pool_create_ex(&ptrans, NULL, NULL, allocator);
       apr_allocator_set_owner(allocator, ptrans);
   
  +    bucket_alloc = apr_bucket_alloc_create(ptrans);
  +
       apr_pool_tag(ptrans, "transaction");
   
       apr_thread_mutex_lock(worker_thread_count_mutex);
  @@ -533,7 +536,8 @@
           * socket options, file descriptors, and read/write buffers.
           */
           current_conn = ap_run_create_connection(ptrans, ap_server_conf, csd, 
  -                                                my_worker_num, sbh);
  +                                                my_worker_num, sbh,
  +                                                bucket_alloc);
           if (current_conn) {
               ap_process_connection(current_conn, csd);
               ap_lingering_close(current_conn);
  
  
  
  1.117     +4 -4      httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -d -u -r1.116 -r1.117
  --- perchild.c	20 Mar 2002 22:19:11 -0000	1.116
  +++ perchild.c	29 Mar 2002 08:17:25 -0000	1.117
  @@ -1540,19 +1540,19 @@
       struct cmsghdr *cmsg;
       int sfd;
       struct iovec iov;
  -    apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  +    conn_rec *c = r->connection;
  +    apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
       perchild_server_conf *sconf = (perchild_server_conf *)
                               ap_get_module_config(r->server->module_config, 
                                                    &mpm_perchild_module);
       char *foo;
       apr_size_t len;
   
  -    apr_pool_userdata_get((void **)&foo, "PERCHILD_BUFFER",
  -                          r->connection->pool);
  +    apr_pool_userdata_get((void **)&foo, "PERCHILD_BUFFER", c->pool);
       len = strlen(foo);
   
       apr_pool_userdata_set(NULL, "PERCHILD_BUFFER", apr_pool_cleanup_null, 
  -                          r->connection->pool);
  +                          c->pool);
   
       apr_os_sock_get(&sfd, thesock);
   
  
  
  
  1.256     +4 -1      httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.255
  retrieving revision 1.256
  diff -u -d -u -r1.255 -r1.256
  --- prefork.c	20 Mar 2002 22:19:11 -0000	1.255
  +++ prefork.c	29 Mar 2002 08:17:25 -0000	1.256
  @@ -527,6 +527,7 @@
       void *csd;
       ap_sb_handle_t *sbh;
       apr_status_t rv;
  +    apr_bucket_alloc_t *bucket_alloc;
   
       my_child_num = child_num_arg;
       ap_my_pid = getpid();
  @@ -576,6 +577,8 @@
       for (i = 0; i < num_listensocks; i++)
           apr_poll_socket_add(pollset, listensocks[i].sd, APR_POLLIN);
   
  +    bucket_alloc = apr_bucket_alloc_create(pchild);
  +
       while (!die_now) {
   	/*
   	 * (Re)initialize this child to a pre-connection state.
  @@ -667,7 +670,7 @@
   	 * socket options, file descriptors, and read/write buffers.
   	 */
   
  -	current_conn = ap_run_create_connection(ptrans, ap_server_conf, csd, my_child_num, sbh);
  +	current_conn = ap_run_create_connection(ptrans, ap_server_conf, csd, my_child_num, sbh, bucket_alloc);
           if (current_conn) {
               ap_process_connection(current_conn, csd);
               ap_lingering_close(current_conn);
  
  
  
  1.252     +7 -2      httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.251
  retrieving revision 1.252
  diff -u -d -u -r1.251 -r1.252
  --- mpm_winnt.c	26 Mar 2002 20:13:37 -0000	1.251
  +++ mpm_winnt.c	29 Mar 2002 08:17:26 -0000	1.252
  @@ -1052,6 +1052,7 @@
   {
       static int requests_this_child = 0;
       PCOMP_CONTEXT context = NULL;
  +    apr_bucket_alloc_t *bucket_alloc;
       apr_os_sock_info_t sockinfo;
       ap_sb_handle_t *sbh;
   
  @@ -1075,6 +1076,9 @@
               break;
           }
   
  +        /* XXX: where does this go? */
  +        bucket_alloc = apr_bucket_alloc_create(context->ptrans);
  +
           /* Have we hit MaxRequestPerChild connections? */
           if (ap_max_requests_per_child) {
               requests_this_child++;
  @@ -1092,8 +1096,9 @@
           apr_os_sock_make(&context->sock, &sockinfo, context->ptrans);
   
           ap_create_sb_handle(&sbh, context->ptrans, 0, thread_num);
  -        c = ap_run_create_connection(context->ptrans, ap_server_conf, context->sock,
  -                                     thread_num, sbh);
  +        c = ap_run_create_connection(context->ptrans, ap_server_conf,
  +                                     context->sock, thread_num, sbh,
  +                                     bucket_alloc);
   
           if (c) {
               ap_process_connection(c, context->sock);
  
  
  
  1.108     +10 -3     httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.107
  retrieving revision 1.108
  diff -u -d -u -r1.107 -r1.108
  --- worker.c	27 Mar 2002 20:37:32 -0000	1.107
  +++ worker.c	29 Mar 2002 08:17:26 -0000	1.108
  @@ -575,7 +575,7 @@
    */
   
   static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num,
  -                           int my_thread_num)
  +                           int my_thread_num, apr_bucket_alloc_t *bucket_alloc)
   {
       conn_rec *current_conn;
       long conn_id = ID_FROM_CHILD_THREAD(my_child_num, my_thread_num);
  @@ -595,7 +595,8 @@
           return;
       }
   
  -    current_conn = ap_run_create_connection(p, ap_server_conf, sock, conn_id, sbh);
  +    current_conn = ap_run_create_connection(p, ap_server_conf, sock,
  +                                            conn_id, sbh, bucket_alloc);
       if (current_conn) {
           ap_process_connection(current_conn, sock);
           ap_lingering_close(current_conn);
  @@ -834,6 +835,7 @@
       int process_slot = ti->pid;
       int thread_slot = ti->tid;
       apr_socket_t *csd = NULL;
  +    apr_bucket_alloc_t *bucket_alloc;
       apr_pool_t *last_ptrans = NULL;
       apr_pool_t *ptrans;                /* Pool for per-transaction stuff */
       apr_status_t rv;
  @@ -841,6 +843,9 @@
       free(ti);
   
       ap_update_child_status_from_indexes(process_slot, thread_slot, SERVER_STARTING, NULL);
  +
  +    bucket_alloc = apr_bucket_alloc_create(apr_thread_pool_get(thd));
  +
       while (!workers_may_exit) {
           ap_update_child_status_from_indexes(process_slot, thread_slot, SERVER_READY, NULL);
           rv = ap_queue_pop(worker_queue, &csd, &ptrans, last_ptrans);
  @@ -870,7 +875,7 @@
               }
               continue;
           }
  -        process_socket(ptrans, csd, process_slot, thread_slot);
  +        process_socket(ptrans, csd, process_slot, thread_slot, bucket_alloc);
           requests_this_child--; /* FIXME: should be synchronized - aaron */
           apr_pool_clear(ptrans);
           last_ptrans = ptrans;
  @@ -878,6 +883,8 @@
   
       ap_update_child_status_from_indexes(process_slot, thread_slot,
           (dying) ? SERVER_DEAD : SERVER_GRACEFUL, (request_rec *) NULL);
  +
  +    apr_bucket_alloc_destroy(bucket_alloc);
   
       apr_thread_exit(thd, APR_SUCCESS);
       return NULL;
  
  
  

Mime
View raw message