rbb 2002/06/02 12:54:50
Modified: buckets apr_buckets_eos.c apr_buckets_file.c
apr_buckets_flush.c apr_buckets_heap.c
apr_buckets_mmap.c apr_buckets_pipe.c
apr_buckets_pool.c apr_buckets_simple.c
apr_buckets_socket.c
include apr_buckets.h
Log:
Move the metadata flag to the bucket_type structure.
Revision Changes Path
1.36 +1 -2 apr-util/buckets/apr_buckets_eos.c
Index: apr_buckets_eos.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_eos.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- apr_buckets_eos.c 31 May 2002 20:51:19 -0000 1.35
+++ apr_buckets_eos.c 2 Jun 2002 19:54:49 -0000 1.36
@@ -67,7 +67,6 @@
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_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,
1.75 +1 -2 apr-util/buckets/apr_buckets_file.c
Index: apr_buckets_file.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- apr_buckets_file.c 31 May 2002 20:51:19 -0000 1.74
+++ apr_buckets_file.c 2 Jun 2002 19:54:49 -0000 1.75
@@ -205,7 +205,6 @@
#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 @@
}
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,
1.28 +1 -2 apr-util/buckets/apr_buckets_flush.c
Index: apr_buckets_flush.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_flush.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- apr_buckets_flush.c 31 May 2002 20:51:19 -0000 1.27
+++ apr_buckets_flush.c 2 Jun 2002 19:54:49 -0000 1.28
@@ -67,7 +67,6 @@
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_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,
1.46 +1 -2 apr-util/buckets/apr_buckets_heap.c
Index: apr_buckets_heap.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_heap.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- apr_buckets_heap.c 31 May 2002 20:51:19 -0000 1.45
+++ apr_buckets_heap.c 2 Jun 2002 19:54:49 -0000 1.46
@@ -106,7 +106,6 @@
}
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_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,
1.52 +1 -2 apr-util/buckets/apr_buckets_mmap.c
Index: apr_buckets_mmap.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_mmap.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- apr_buckets_mmap.c 31 May 2002 20:51:19 -0000 1.51
+++ apr_buckets_mmap.c 2 Jun 2002 19:54:49 -0000 1.52
@@ -120,7 +120,6 @@
}
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 @@
}
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,
1.50 +1 -2 apr-util/buckets/apr_buckets_pipe.c
Index: apr_buckets_pipe.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_pipe.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- apr_buckets_pipe.c 31 May 2002 20:51:19 -0000 1.49
+++ apr_buckets_pipe.c 2 Jun 2002 19:54:49 -0000 1.50
@@ -132,7 +132,6 @@
b->length = (apr_size_t)(-1);
b->start = -1;
b->data = p;
- b->is_metadata = 0;
return b;
}
@@ -149,7 +148,7 @@
}
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,
1.31 +1 -2 apr-util/buckets/apr_buckets_pool.c
Index: apr_buckets_pool.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_pool.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- apr_buckets_pool.c 31 May 2002 20:51:19 -0000 1.30
+++ apr_buckets_pool.c 2 Jun 2002 19:54:49 -0000 1.31
@@ -145,7 +145,6 @@
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_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*/
1.41 +2 -2 apr-util/buckets/apr_buckets_simple.c
Index: apr_buckets_simple.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_simple.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- apr_buckets_simple.c 18 Apr 2002 18:41:21 -0000 1.40
+++ apr_buckets_simple.c 2 Jun 2002 19:54:49 -0000 1.41
@@ -157,7 +157,7 @@
}
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 @@
};
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,
1.40 +1 -2 apr-util/buckets/apr_buckets_socket.c
Index: apr_buckets_socket.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_socket.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- apr_buckets_socket.c 31 May 2002 20:51:19 -0000 1.39
+++ apr_buckets_socket.c 2 Jun 2002 19:54:49 -0000 1.40
@@ -126,7 +126,6 @@
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_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,
1.141 +10 -5 apr-util/include/apr_buckets.h
Index: apr_buckets.h
===================================================================
RCS file: /home/cvs/apr-util/include/apr_buckets.h,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- apr_buckets.h 31 May 2002 20:51:20 -0000 1.140
+++ apr_buckets.h 2 Jun 2002 19:54:49 -0000 1.141
@@ -152,6 +152,11 @@
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 @@
*/
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 @@
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 @@
* @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