diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-10-13 05:35:55 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-10-13 05:35:55 +0000 |
commit | 5ac95967b554f17ac704fc778686e4a794576fbd (patch) | |
tree | dab3cf51cb4c81034ae8cc3e84c3e41e819f104e /buckets/apr_buckets_mmap.c | |
parent | ae236f35d4bd5a5169233f36fedb9afafa66d5b7 (diff) | |
download | libapr-util-5ac95967b554f17ac704fc778686e4a794576fbd.tar.gz |
Remove all function pointers from the ap_bucket type. These function
pointers are replaced with a global table that allows modules to register
their bucket types. Those bucket types are then allowed to be used in
the server processing. This also required removing all direct calls to
those functions. The ap_bucket type has an index into an array, so in
each ap_bucket_* function, we use that index to find the correct set of
functions.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@57891 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets/apr_buckets_mmap.c')
-rw-r--r-- | buckets/apr_buckets_mmap.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/buckets/apr_buckets_mmap.c b/buckets/apr_buckets_mmap.c index fecd3509..1efeb56c 100644 --- a/buckets/apr_buckets_mmap.c +++ b/buckets/apr_buckets_mmap.c @@ -56,6 +56,8 @@ #include "ap_buckets.h" #include <stdlib.h> +static int mmap_type; + static apr_status_t mmap_read(ap_bucket *b, const char **str, apr_ssize_t *length, int block) { @@ -104,11 +106,7 @@ API_EXPORT(ap_bucket *) ap_bucket_make_mmap(ap_bucket *b, return NULL; } - b->type = AP_BUCKET_MMAP; - b->split = ap_bucket_split_shared; - b->destroy = mmap_destroy; - b->read = mmap_read; - b->setaside = NULL; + b->type = mmap_type; return b; } @@ -119,3 +117,19 @@ API_EXPORT(ap_bucket *) ap_bucket_create_mmap( { ap_bucket_do_create(ap_bucket_make_mmap(b, mm, start, length)); } + +void ap_bucket_mmap_register(apr_pool_t *p) +{ + ap_bucket_type type; + type.split = ap_bucket_split_shared; + type.destroy = mmap_destroy; + type.read = mmap_read; + type.setaside = NULL; + + mmap_type = ap_insert_bucket_type(&type); +} + +int ap_mmap_type(void) +{ + return mmap_type; +} |