Okay, so since some of you were displeased with the size of the phase 1
patch that I committed, here's your chance to review phase 2 beforehand.

Assuming you all approve of this, I'll patch httpd to match.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA

Index: buckets/apr_brigade.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_brigade.c,v
retrieving revision 1.25
diff -u -d -r1.25 apr_brigade.c
--- buckets/apr_brigade.c       2001/09/03 22:00:36     1.25
+++ buckets/apr_brigade.c       2001/09/03 22:11:46
@@ -249,7 +249,8 @@
 
 static int check_brigade_flush(const char **str, 
                                apr_size_t *n, apr_bucket_brigade *bb,
-                               apr_brigade_flush flush)
+                               apr_brigade_flush flush,
+                               apr_sms_t *sms)
 {
     apr_bucket *b = APR_BRIGADE_LAST(bb);
 
@@ -257,10 +258,11 @@
         if (*n > APR_BUCKET_BUFF_SIZE) {
             apr_bucket *e;
             if (flush) {
-                e = apr_bucket_transient_create(*str, *n);
+                e = apr_bucket_transient_create(*str, *n, sms);
             }
             else {
-                e = apr_bucket_heap_create(*str, *n, 0, NULL);
+                /* XXX: this is broken... heap_create needs to copy the data */
+                e = apr_bucket_heap_create(*str, *n, 0, NULL, sms);
             }
             APR_BRIGADE_INSERT_TAIL(bb, e);
             return 1;
@@ -274,12 +276,13 @@
         apr_bucket_heap *h = b->data;
 
         if (*n > (h->alloc_len - b->length)) {
-            APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_transient_create(*str, *n));
+            APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_transient_create(*str,
+                                                                    *n, sms));
             return 1;
         }
     }
     else if (*n > APR_BUCKET_BUFF_SIZE) {
-        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_transient_create(*str, *n));
+        APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_transient_create(*str, *n, 
sms));
         return 1;
     }
 
@@ -289,6 +292,7 @@
 APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, 
                                                apr_brigade_flush flush,
                                                void *ctx,
+                                               apr_sms_t *sms,
                                                va_list va)
 {
     for (;;) {
@@ -298,7 +302,7 @@
         if (str == NULL)
             break;
 
-        rv = apr_brigade_write(b, flush, ctx, str, strlen(str));
+        rv = apr_brigade_write(b, flush, ctx, str, strlen(str), sms);
         if (rv != APR_SUCCESS)
             return rv;
     }
@@ -308,17 +312,18 @@
 
 APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
                                            apr_brigade_flush flush, void *ctx,
-                                           const char c)
+                                           const char c, apr_sms_t *sms)
 {
-    return apr_brigade_write(b, flush, ctx, &c, 1);
+    return apr_brigade_write(b, flush, ctx, &c, 1, sms);
 }
 
 APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *bb, 
                                             apr_brigade_flush flush,
                                             void *ctx, 
-                                            const char *str, apr_size_t nbyte)
+                                            const char *str, apr_size_t nbyte,
+                                            apr_sms_t *sms)
 {
-    if (check_brigade_flush(&str, &nbyte, bb, flush)) {
+    if (check_brigade_flush(&str, &nbyte, bb, flush, sms)) {
         if (flush) {
             return flush(bb, ctx);
         }
@@ -329,7 +334,7 @@
 
         if (APR_BRIGADE_EMPTY(bb) || !APR_BUCKET_IS_HEAP(b)) {
             buf = malloc(APR_BUCKET_BUFF_SIZE);
-            b = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE, 0, NULL);
+            b = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE, 0, NULL, 
sms);
             APR_BRIGADE_INSERT_TAIL(bb, b);
             b->length = 0;   /* We are writing into the brigade, and
                               * allocating more memory than we need.  This
@@ -352,34 +357,35 @@
 
 APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *b,
                                            apr_brigade_flush flush, void *ctx,
-                                           const char *str)
+                                           const char *str, apr_sms_t *sms)
 {
-    return apr_brigade_write(b, flush, ctx, str, strlen(str));
+    return apr_brigade_write(b, flush, ctx, str, strlen(str), sms);
 }
 
 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, 
                                                      apr_brigade_flush flush,
-                                                     void *ctx, ...)
+                                                     void *ctx, apr_sms_t *sms,
+                                                     ...)
 {
     va_list va;
     apr_status_t rv;
 
-    va_start(va, ctx);
-    rv = apr_brigade_vputstrs(b, flush, ctx, va);
+    va_start(va, sms);
+    rv = apr_brigade_vputstrs(b, flush, ctx, sms, va);
     va_end(va);
     return rv;
 }
 
 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, 
                                                     apr_brigade_flush flush,
-                                                    void *ctx, 
+                                                    void *ctx, apr_sms_t *sms,
                                                     const char *fmt, ...)
 {
     va_list ap;
     apr_status_t rv;
 
     va_start(ap, fmt);
-    rv = apr_brigade_vprintf(b, flush, ctx, fmt, ap);
+    rv = apr_brigade_vprintf(b, flush, ctx, sms, fmt, ap);
     va_end(ap);
     return rv;
 }
@@ -389,6 +395,7 @@
 
     apr_bucket_brigade *b;  /* associated brigade */
     apr_brigade_flush *flusher; /* flushing function */
+    apr_sms_t *sms;
     void *ctx;
 
     char *cbuff; /* buffer to flush from */
@@ -406,10 +413,10 @@
     apr_status_t res = APR_SUCCESS;
 
     res = apr_brigade_write(vd->b, *vd->flusher, vd->ctx, vd->cbuff,
-                          APR_BUCKET_BUFF_SIZE);
+                            APR_BUCKET_BUFF_SIZE, vd->sms);
 
-    if(res != APR_SUCCESS) {
-      return -1;
+    if (res != APR_SUCCESS) {
+        return -1;
     }
 
     vd->vbuff.curpos = vd->cbuff;
@@ -420,7 +427,7 @@
 
 APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b,
                                               apr_brigade_flush flush,
-                                              void *ctx,
+                                              void *ctx, apr_sms_t *sms,
                                               const char *fmt, va_list va)
 {
     /* the cast, in order of appearance */
@@ -432,19 +439,20 @@
     vd.vbuff.endpos = buf + APR_BUCKET_BUFF_SIZE;
     vd.b = b;
     vd.flusher = &flush;
+    vd.sms = sms;
     vd.ctx = ctx;
     vd.cbuff = buf;
 
     written = apr_vformatter(brigade_flush, &vd.vbuff, fmt, va);
 
     if (written == -1) {
-      return -1;
+        return -1;
     }
 
     /* tack on null terminator to remaining string */
     *(vd.vbuff.curpos) = '\0';
 
     /* write out what remains in the buffer */
-    return apr_brigade_write(b, flush, ctx, buf, vd.vbuff.curpos - buf);
+    return apr_brigade_write(b, flush, ctx, buf, vd.vbuff.curpos - buf, sms);
 }
 
Index: buckets/apr_buckets_eos.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_eos.c,v
retrieving revision 1.29
diff -u -d -r1.29 apr_buckets_eos.c
--- buckets/apr_buckets_eos.c   2001/08/25 22:54:56     1.29
+++ buckets/apr_buckets_eos.c   2001/09/03 22:11:46
@@ -64,7 +64,7 @@
 
 static apr_status_t eos_copy(apr_bucket *e, apr_bucket **c)
 {
-    *c = apr_bucket_eos_create();
+    *c = apr_bucket_eos_create(e->sms);
     return APR_SUCCESS;
 }
 
@@ -78,16 +78,9 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_eos_create(void)
+APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_eos_make(b);
Index: buckets/apr_buckets_file.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
retrieving revision 1.55
diff -u -d -r1.55 apr_buckets_file.c
--- buckets/apr_buckets_file.c  2001/08/25 22:54:56     1.55
+++ buckets/apr_buckets_file.c  2001/09/03 22:11:46
@@ -223,16 +223,10 @@
 
 APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd,
                                                  apr_off_t offset,
-                                                 apr_size_t len, apr_pool_t *p)
+                                                 apr_size_t len, apr_pool_t *p,
+                                                 apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_file_make(b, fd, offset, len, p);
Index: buckets/apr_buckets_flush.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_flush.c,v
retrieving revision 1.21
diff -u -d -r1.21 apr_buckets_flush.c
--- buckets/apr_buckets_flush.c 2001/08/25 22:54:56     1.21
+++ buckets/apr_buckets_flush.c 2001/09/03 22:11:46
@@ -64,7 +64,7 @@
 
 static apr_status_t flush_copy(apr_bucket *e, apr_bucket **c)
 {
-    *c = apr_bucket_flush_create();
+    *c = apr_bucket_flush_create(e->sms);
     return APR_SUCCESS;
 }
 
@@ -78,16 +78,9 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_flush_create(void)
+APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_flush_make(b);
Index: buckets/apr_buckets_heap.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_heap.c,v
retrieving revision 1.37
diff -u -d -r1.37 apr_buckets_heap.c
--- buckets/apr_buckets_heap.c  2001/08/25 22:54:56     1.37
+++ buckets/apr_buckets_heap.c  2001/09/03 22:11:46
@@ -109,17 +109,12 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_heap_create(
-               const char *buf, apr_size_t length, int copy, apr_size_t *w)
+APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf,
+                                                 apr_size_t length,
+                                                 int copy, apr_size_t *w,
+                                                 apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_heap_make(b, buf, length, copy, w);
Index: buckets/apr_buckets_mmap.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_mmap.c,v
retrieving revision 1.42
diff -u -d -r1.42 apr_buckets_mmap.c
--- buckets/apr_buckets_mmap.c  2001/08/25 22:54:56     1.42
+++ buckets/apr_buckets_mmap.c  2001/09/03 22:11:47
@@ -104,17 +104,12 @@
 }
 
 
-APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(
-               apr_mmap_t *mm, apr_off_t start, apr_size_t length)
+APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm,
+                                                 apr_off_t start,
+                                                 apr_size_t length,
+                                                 apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_mmap_make(b, mm, start, length);
Index: buckets/apr_buckets_pipe.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_pipe.c,v
retrieving revision 1.40
diff -u -d -r1.40 apr_buckets_pipe.c
--- buckets/apr_buckets_pipe.c  2001/08/25 22:54:56     1.40
+++ buckets/apr_buckets_pipe.c  2001/09/03 22:11:47
@@ -101,7 +101,7 @@
         h = a->data;
         h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
         *str = buf;
-        APR_BUCKET_INSERT_AFTER(a, apr_bucket_pipe_create(p));
+        APR_BUCKET_INSERT_AFTER(a, apr_bucket_pipe_create(p, a->sms));
     }
     else {
         free(buf);
@@ -141,16 +141,9 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *p)
+APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *p, apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_pipe_make(b, p);
Index: buckets/apr_buckets_pool.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_pool.c,v
retrieving revision 1.23
diff -u -d -r1.23 apr_buckets_pool.c
--- buckets/apr_buckets_pool.c  2001/08/25 22:54:56     1.23
+++ buckets/apr_buckets_pool.c  2001/09/03 22:11:47
@@ -157,17 +157,12 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_pool_create(
-               const char *buf, apr_size_t length, apr_pool_t *pool)
+APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf,
+                                                 apr_size_t length,
+                                                 apr_pool_t *pool,
+                                                 apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_pool_make(b, buf, length, pool);
Index: buckets/apr_buckets_simple.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_simple.c,v
retrieving revision 1.34
diff -u -d -r1.34 apr_buckets_simple.c
--- buckets/apr_buckets_simple.c        2001/08/25 23:05:52     1.34
+++ buckets/apr_buckets_simple.c        2001/09/03 22:11:47
@@ -101,17 +101,11 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(
-               const char *buf, apr_size_t length)
+APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
+                                                     apr_size_t length,
+                                                     apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_immortal_make(b, buf, length);
@@ -142,17 +136,11 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_transient_create(
-               const char *buf, apr_size_t length)
+APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
+                                                      apr_size_t length,
+                                                      apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_transient_make(b, buf, length);
Index: buckets/apr_buckets_socket.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_socket.c,v
retrieving revision 1.29
diff -u -d -r1.29 apr_buckets_socket.c
--- buckets/apr_buckets_socket.c        2001/08/25 22:54:56     1.29
+++ buckets/apr_buckets_socket.c        2001/09/03 22:11:47
@@ -104,7 +104,7 @@
         h = a->data;
         h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
         *str = buf;
-        APR_BUCKET_INSERT_AFTER(a, apr_bucket_socket_create(p));
+        APR_BUCKET_INSERT_AFTER(a, apr_bucket_socket_create(p, a->sms));
     }
     else {
         free(buf);
@@ -136,16 +136,10 @@
     return b;
 }
 
-APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *p)
+APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *p,
+                                                   apr_sms_t *sms)
 {
-    apr_sms_t *sms;
-    apr_bucket *b;
-
-    if (!apr_bucket_global_sms) {
-        apr_sms_std_create(&apr_bucket_global_sms);
-    }
-    sms = apr_bucket_global_sms;
-    b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
+    apr_bucket *b = (apr_bucket *)apr_sms_malloc(sms, sizeof(*b));
     APR_BUCKET_INIT(b);
     b->sms = sms;
     return apr_bucket_socket_make(b, p);
Index: include/apr_buckets.h
===================================================================
RCS file: /home/cvs/apr-util/include/apr_buckets.h,v
retrieving revision 1.116
diff -u -d -r1.116 apr_buckets.h
--- include/apr_buckets.h       2001/08/31 20:39:09     1.116
+++ include/apr_buckets.h       2001/09/03 22:11:47
@@ -738,86 +738,98 @@
 /**
  * This function writes a list of strings into a bucket brigade. 
  * @param b The bucket brigade to add to
+ * @param sms The SMS from which to allocate any needed buckets
  * @param va A list of strings to add
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_vputstrs(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, va_list va)
+ * @deffunc apr_status_t apr_brigade_vputstrs(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, apr_sms_t *sms, va_list va)
  */
 APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b,
                                                apr_brigade_flush flush,
                                                void *ctx,
+                                               apr_sms_t *sms,
                                                va_list va);
 
 /**
  * This function writes an string into a bucket brigade.
  * @param b The bucket brigade to add to
  * @param str The string to add
+ * @param sms The SMS from which to allocate any needed buckets
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_write(ap_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *str, apr_size_t nbyte)
+ * @deffunc apr_status_t apr_brigade_write(ap_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *str, apr_size_t nbyte, 
apr_sms_t *sms)
  */
 APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b,
                                             apr_brigade_flush flush, void *ctx,
-                                            const char *str, apr_size_t nbyte);
+                                            const char *str, apr_size_t nbyte,
+                                            apr_sms_t *sms);
 
 /**
  * This function writes an string into a bucket brigade.
  * @param b The bucket brigade to add to
  * @param str The string to add
+ * @param sms The SMS from which to allocate any needed buckets
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_puts(ap_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *str)
+ * @deffunc apr_status_t apr_brigade_puts(ap_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *str, apr_sms_t *sms)
  */
 APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *b,
                                            apr_brigade_flush flush, void *ctx,
-                                           const char *str);
+                                           const char *str, apr_sms_t *sms);
 
 /**
  * This function writes a character into a bucket brigade.
  * @param b The bucket brigade to add to
  * @param c The character to add
+ * @param sms The SMS from which to allocate any needed buckets
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_putc(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char c)
+ * @deffunc apr_status_t apr_brigade_putc(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char c, apr_sms_t *sms)
  */
 APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
                                            apr_brigade_flush flush, void *ctx,
-                                           const char c);
+                                           const char c, apr_sms_t *sms);
 
 /**
  * This function writes an unspecified number of strings into a bucket brigade.
  * @param b The bucket brigade to add to
+ * @param sms The SMS from which to allocate any needed buckets
  * @param ... The strings to add
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_putstrs(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, ...)
+ * @deffunc apr_status_t apr_brigade_putstrs(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, apr_sms_t *sms, ...)
  */
 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
                                                      apr_brigade_flush flush,
-                                                     void *ctx, ...);
+                                                     void *ctx, apr_sms_t *sms,
+                                                     ...);
 
 /**
  * Evaluate a printf and put the resulting string at the end 
  * of the bucket brigade.
  * @param b The brigade to write to
+ * @param sms The SMS from which to allocate any needed buckets
  * @param fmt The format of the string to write
  * @param ... The arguments to fill out the format
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_printf(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *fmt, ...) 
+ * @deffunc apr_status_t apr_brigade_printf(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, apr_sms_t *sms, const char *fmt, ...) 
  */
 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, 
                                                     apr_brigade_flush flush,
                                                     void *ctx,
+                                                    apr_sms_t *sms,
                                                     const char *fmt, ...)
-        __attribute__((format(printf,4,5)));
+        __attribute__((format(printf,5,6)));
 
 /**
  * Evaluate a printf and put the resulting string at the end 
  * of the bucket brigade.
  * @param b The brigade to write to
+ * @param sms The SMS from which to allocate any needed buckets
  * @param fmt The format of the string to write
  * @param va The arguments to fill out the format
  * @return The number of bytes added to the brigade
- * @deffunc apr_status_t apr_brigade_vprintf(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, const char *fmt, va_list va) 
+ * @deffunc apr_status_t apr_brigade_vprintf(apr_bucket_brigade *b, 
apr_brigade_flush flush, void *ctx, apr_sms_t *sms, const char *fmt, va_list 
va) 
  */
 APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, 
                                               apr_brigade_flush flush,
                                               void *ctx,
+                                              apr_sms_t *sms,
                                               const char *fmt, va_list va);
 
 
@@ -1118,10 +1130,11 @@
 /**
  * Create an End of Stream bucket.  This indicates that there is no more data
  * coming from down the filter stack.  All filters should flush at this point.
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_eos_create(void)
+ * @deffunc apr_bucket *apr_bucket_eos_create(apr_sms_t *sms)
  */
-APU_DECLARE(apr_bucket *) apr_bucket_eos_create(void);
+APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_sms_t *sms);
 
 /**
  * Make the bucket passed in an EOS bucket.  This indicates that there is no 
@@ -1137,10 +1150,11 @@
  * Create a flush  bucket.  This indicates that filters should flush their
  * data.  There is no guarantee that they will flush it, but this is the
  * best we can do.
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_flush_create(void)
+ * @deffunc apr_bucket *apr_bucket_flush_create(apr_sms_t *sms)
  */
-APU_DECLARE(apr_bucket *) apr_bucket_flush_create(void);
+APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a FLUSH  bucket.  This indicates that filters 
@@ -1156,11 +1170,13 @@
  * Create a bucket referring to long-lived data.
  * @param buf The data to insert into the bucket
  * @param nbyte The size of the data to insert.
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_immortal_create(const char *buf, apr_size_t 
nbyte)
+ * @deffunc apr_bucket *apr_bucket_immortal_create(const char *buf, apr_size_t 
nbyte, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, 
-                                                     apr_size_t nbyte);
+                                                     apr_size_t nbyte,
+                                                     apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to long-lived data
@@ -1178,11 +1194,13 @@
  * Create a bucket referring to data on the stack.
  * @param buf The data to insert into the bucket
  * @param nbyte The size of the data to insert.
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_transient_create(const char *buf, 
apr_size_t nbyte)
+ * @deffunc apr_bucket *apr_bucket_transient_create(const char *buf, 
apr_size_t nbyte, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, 
-                                                      apr_size_t nbyte);
+                                                      apr_size_t nbyte,
+                                                      apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to stack data
@@ -1208,12 +1226,14 @@
  * @param copy Whether to copy the data into newly-allocated memory or not
  * @param w The number of bytes actually copied into the bucket.
  *          If copy is zero then this return value can be ignored by passing a 
NULL pointer.
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_heap_create(const char *buf, apr_size_t 
nbyte, int copy, apr_size_t *w)
+ * @deffunc apr_bucket *apr_bucket_heap_create(const char *buf, apr_size_t 
nbyte, int copy, apr_size_t *w, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, 
                                                  apr_size_t nbyte, int copy, 
-                                                 apr_size_t *w);
+                                                 apr_size_t *w,
+                                                 apr_sms_t *sms);
 /**
  * Make the bucket passed in a bucket refer to heap data
  * @param b The bucket to make into a HEAP bucket
@@ -1235,12 +1255,14 @@
  * @param buf The buffer to insert into the bucket
  * @param length The number of bytes referred to by this bucket
  * @param pool The pool the memory was allocated from
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_pool_create(const char *buf, apr_size_t 
*length, apr_pool_t *pool)
+ * @deffunc apr_bucket *apr_bucket_pool_create(const char *buf, apr_size_t 
*length, apr_pool_t *pool, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, 
                                                  apr_size_t length,
-                                                 apr_pool_t *pool);
+                                                 apr_pool_t *pool,
+                                                 apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to pool data
@@ -1262,12 +1284,14 @@
  * @param start The offset of the first byte in the mmap
  *              that this bucket refers to
  * @param length The number of bytes referred to by this bucket
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_mmap_create(const apr_mmap_t *mm, 
apr_size_t start, apr_size_t length)
+ * @deffunc apr_bucket *apr_bucket_mmap_create(const apr_mmap_t *mm, 
apr_size_t start, apr_size_t length, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, 
                                                  apr_off_t start,
-                                                 apr_size_t length);
+                                                 apr_size_t length,
+                                                 apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to an MMAP'ed file
@@ -1287,10 +1311,12 @@
 /**
  * Create a bucket referring to a socket.
  * @param thissocket The socket to put in the bucket
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_socket_create(apr_socket_t *thissocket)
+ * @deffunc apr_bucket *apr_bucket_socket_create(apr_socket_t *thissocket, 
apr_sms_t *sms)
  */
-APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock);
+APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock,
+                                                   apr_sms_t *sms);
 /**
  * Make the bucket passed in a bucket refer to a socket
  * @param b The bucket to make into a SOCKET bucket
@@ -1304,10 +1330,12 @@
 /**
  * Create a bucket referring to a pipe.
  * @param thispipe The pipe to put in the bucket
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_pipe_create(apr_file_t *thispipe)
+ * @deffunc apr_bucket *apr_bucket_pipe_create(apr_file_t *thispipe, apr_sms_t 
*sms)
  */
-APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe);
+APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe,
+                                                 apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to a pipe
@@ -1326,13 +1354,15 @@
  * @param len The amount of data in the file we are interested in
  * @param p The pool into which any needed structures should be created
  *          while reading from this file bucket
+ * @param sms The SMS from which this bucket should be allocated
  * @return The new bucket, or NULL if allocation failed
- * @deffunc apr_bucket *apr_bucket_file_create(apr_file_t *fd, apr_off_t 
offset, apr_size_t len, apr_pool_t *p)
+ * @deffunc apr_bucket *apr_bucket_file_create(apr_file_t *fd, apr_off_t 
offset, apr_size_t len, apr_pool_t *p, apr_sms_t *sms)
  */
 APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd,
                                                  apr_off_t offset,
                                                  apr_size_t len, 
-                                                 apr_pool_t *p);
+                                                 apr_pool_t *p,
+                                                 apr_sms_t *sms);
 
 /**
  * Make the bucket passed in a bucket refer to a file

Reply via email to