summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buckets/apr_buckets_eos.c3
-rw-r--r--buckets/apr_buckets_file.c3
-rw-r--r--buckets/apr_buckets_flush.c3
-rw-r--r--buckets/apr_buckets_heap.c3
-rw-r--r--buckets/apr_buckets_mmap.c3
-rw-r--r--buckets/apr_buckets_pipe.c3
-rw-r--r--buckets/apr_buckets_pool.c3
-rw-r--r--buckets/apr_buckets_simple.c4
-rw-r--r--buckets/apr_buckets_socket.c3
-rw-r--r--include/apr_buckets.h15
10 files changed, 20 insertions, 23 deletions
diff --git a/buckets/apr_buckets_eos.c b/buckets/apr_buckets_eos.c
index 4a0ea773..ed61c870 100644
--- a/buckets/apr_buckets_eos.c
+++ b/buckets/apr_buckets_eos.c
@@ -67,7 +67,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b)
b->length = 0;
b->start = 0;
b->data = NULL;
- b->is_metadata = 1;
b->type = &apr_bucket_type_eos;
return b;
@@ -84,7 +83,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list)
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_eos = {
- "EOS", 5,
+ "EOS", 5, APR_BUCKET_METADATA,
apr_bucket_destroy_noop,
eos_bucket_read,
apr_bucket_setaside_noop,
diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c
index e0c2378c..864d97f7 100644
--- a/buckets/apr_buckets_file.c
+++ b/buckets/apr_buckets_file.c
@@ -205,7 +205,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd,
#endif
b = apr_bucket_shared_make(b, f, offset, len);
- b->is_metadata = 0;
b->type = &apr_bucket_type_file;
return b;
@@ -265,7 +264,7 @@ static apr_status_t file_bucket_setaside(apr_bucket *data, apr_pool_t *reqpool)
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_file = {
- "FILE", 5,
+ "FILE", 5, APR_BUCKET_DATA,
file_bucket_destroy,
file_bucket_read,
file_bucket_setaside,
diff --git a/buckets/apr_buckets_flush.c b/buckets/apr_buckets_flush.c
index 8cbf6468..6a960443 100644
--- a/buckets/apr_buckets_flush.c
+++ b/buckets/apr_buckets_flush.c
@@ -67,7 +67,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b)
b->length = 0;
b->start = 0;
b->data = NULL;
- b->is_metadata = 1;
b->type = &apr_bucket_type_flush;
return b;
@@ -84,7 +83,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list)
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_flush = {
- "FLUSH", 5,
+ "FLUSH", 5, APR_BUCKET_METADATA,
apr_bucket_destroy_noop,
flush_bucket_read,
apr_bucket_setaside_noop,
diff --git a/buckets/apr_buckets_heap.c b/buckets/apr_buckets_heap.c
index b8da9333..27a8395c 100644
--- a/buckets/apr_buckets_heap.c
+++ b/buckets/apr_buckets_heap.c
@@ -106,7 +106,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf,
}
b = apr_bucket_shared_make(b, h, 0, length);
- b->is_metadata = 0;
b->type = &apr_bucket_type_heap;
return b;
@@ -126,7 +125,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf,
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_heap = {
- "HEAP", 5,
+ "HEAP", 5, APR_BUCKET_DATA,
heap_bucket_destroy,
heap_bucket_read,
apr_bucket_setaside_noop,
diff --git a/buckets/apr_buckets_mmap.c b/buckets/apr_buckets_mmap.c
index 29921872..11d1b2c6 100644
--- a/buckets/apr_buckets_mmap.c
+++ b/buckets/apr_buckets_mmap.c
@@ -120,7 +120,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm,
}
b = apr_bucket_shared_make(b, m, start, length);
- b->is_metadata = 0;
b->type = &apr_bucket_type_mmap;
return b;
@@ -172,7 +171,7 @@ static apr_status_t mmap_bucket_setaside(apr_bucket *data, apr_pool_t *p)
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_mmap = {
- "MMAP", 5,
+ "MMAP", 5, APR_BUCKET_DATA,
mmap_bucket_destroy,
mmap_bucket_read,
mmap_bucket_setaside,
diff --git a/buckets/apr_buckets_pipe.c b/buckets/apr_buckets_pipe.c
index a64c47cc..86986588 100644
--- a/buckets/apr_buckets_pipe.c
+++ b/buckets/apr_buckets_pipe.c
@@ -132,7 +132,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, apr_file_t *p)
b->length = (apr_size_t)(-1);
b->start = -1;
b->data = p;
- b->is_metadata = 0;
return b;
}
@@ -149,7 +148,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *p,
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_pipe = {
- "PIPE", 5,
+ "PIPE", 5, APR_BUCKET_DATA,
apr_bucket_destroy_noop,
pipe_bucket_read,
apr_bucket_setaside_notimpl,
diff --git a/buckets/apr_buckets_pool.c b/buckets/apr_buckets_pool.c
index 7917928b..c7c9023a 100644
--- a/buckets/apr_buckets_pool.c
+++ b/buckets/apr_buckets_pool.c
@@ -145,7 +145,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b,
p->list = b->list;
b = apr_bucket_shared_make(b, p, 0, length);
- b->is_metadata = 0;
b->type = &apr_bucket_type_pool;
/* pre-initialize heap bucket member */
@@ -172,7 +171,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf,
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_pool = {
- "POOL", 5,
+ "POOL", 5, APR_BUCKET_DATA,
pool_bucket_destroy,
pool_bucket_read,
apr_bucket_setaside_noop, /* don't need to setaside thanks to the cleanup*/
diff --git a/buckets/apr_buckets_simple.c b/buckets/apr_buckets_simple.c
index d9de0bd4..fc411580 100644
--- a/buckets/apr_buckets_simple.c
+++ b/buckets/apr_buckets_simple.c
@@ -157,7 +157,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
}
const apr_bucket_type_t apr_bucket_type_immortal = {
- "IMMORTAL", 5,
+ "IMMORTAL", 5, APR_BUCKET_DATA,
apr_bucket_destroy_noop,
simple_bucket_read,
apr_bucket_setaside_noop,
@@ -166,7 +166,7 @@ const apr_bucket_type_t apr_bucket_type_immortal = {
};
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_transient = {
- "TRANSIENT", 5,
+ "TRANSIENT", 5, APR_BUCKET_DATA,
apr_bucket_destroy_noop,
simple_bucket_read,
transient_bucket_setaside,
diff --git a/buckets/apr_buckets_socket.c b/buckets/apr_buckets_socket.c
index 1faa0e46..ba43bf43 100644
--- a/buckets/apr_buckets_socket.c
+++ b/buckets/apr_buckets_socket.c
@@ -126,7 +126,6 @@ APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, apr_socket_t *p)
b->type = &apr_bucket_type_socket;
b->length = (apr_size_t)(-1);
b->start = -1;
- b->is_metadata = 0;
b->data = p;
return b;
@@ -144,7 +143,7 @@ APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *p,
}
APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_socket = {
- "SOCKET", 5,
+ "SOCKET", 5, APR_BUCKET_DATA,
apr_bucket_destroy_noop,
socket_bucket_read,
apr_bucket_setaside_notimpl,
diff --git a/include/apr_buckets.h b/include/apr_buckets.h
index b6fbe785..906fcad6 100644
--- a/include/apr_buckets.h
+++ b/include/apr_buckets.h
@@ -152,6 +152,11 @@ typedef struct apr_bucket_brigade apr_bucket_brigade;
typedef struct apr_bucket apr_bucket;
typedef struct apr_bucket_alloc_t apr_bucket_alloc_t;
+/** This bucket type represents actual data to send to the client. */
+#define APR_BUCKET_DATA 0
+/** This bucket type represents metadata. */
+#define APR_BUCKET_METADATA 1
+
typedef struct apr_bucket_type_t apr_bucket_type_t;
struct apr_bucket_type_t {
/**
@@ -164,6 +169,10 @@ struct apr_bucket_type_t {
*/
int num_func;
/**
+ * Does the bucket contain metadata
+ */
+ int is_metadata;
+ /**
* Free the private data and any resources used by the bucket (if they
* aren't shared with another bucket). This function is required to be
* implemented for all bucket types, though it might be a no-op on some
@@ -261,10 +270,6 @@ struct apr_bucket {
void (*free)(void *e);
/** The freelist from which this bucket was allocated */
apr_bucket_alloc_t *list;
- /**
- * Does the bucket contain metadata
- */
- int is_metadata;
};
/** A list of buckets */
@@ -455,7 +460,7 @@ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
* @param e The bucket to inspect
* @return true or false
*/
-#define APR_BUCKET_IS_METADATA(e) (e->is_metadata)
+#define APR_BUCKET_IS_METADATA(e) (e->type->is_metadata)
/**
* Determine if a bucket is a FLUSH bucket