From 53ad28033909dd1652da7530f37375371b915361 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 13 May 2009 19:44:56 +0000 Subject: [PATCH] add API back from r774454 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774500 13f79535-47bb-0310-9956-ffa450edef68 --- include/ap_slotmem.h | 17 +++++++++++++++++ modules/mem/mod_plainmem.c | 1 + modules/mem/mod_sharedmem.c | 1 + server/slotmem.c | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/include/ap_slotmem.h b/include/ap_slotmem.h index aac7ea046f..e59ef72096 100644 --- a/include/ap_slotmem.h +++ b/include/ap_slotmem.h @@ -100,6 +100,14 @@ struct ap_slotmem_storage_method { * @return APR_SUCCESS if all went well */ apr_status_t (* slotmem_attach)(ap_slotmem_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool); + /** + * get the memory ptr associated with this worker slot. + * @param s ap_slotmem_t to use. + * @param item_id item to return for 0 to item_num + * @param mem address to store the pointer to the slot + * @return APR_SUCCESS if all went well + */ + apr_status_t (* slotmem_mem)(ap_slotmem_t *s, unsigned int item_id, void**mem); /** * retrieve the memory associated with this worker slot. * @param s ap_slotmem_t to use. @@ -189,6 +197,15 @@ AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slo * @return APR_SUCCESS if all went well */ AP_DECLARE(apr_status_t) ap_slotmem_attach(ap_slotmem_storage_method *sm, ap_slotmem_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool); +/** + * get the memory associated with this worker slot. + * @param sm ap_slotmem_storage_method provider obtained + * @param s ap_slotmem_t to use. + * @param item_id item to return for 0 to item_num + * @param mem address to store the pointer to the slot + * @return APR_SUCCESS if all went well + */ +AP_DECLARE(apr_status_t) ap_slotmem_mem(ap_slotmem_storage_method *sm, ap_slotmem_t *s, unsigned int item_id, void**mem); /** * retrieve the memory associated with this worker slot. * @param sm ap_slotmem_storage_method provider obtained diff --git a/modules/mem/mod_plainmem.c b/modules/mem/mod_plainmem.c index 848f52026c..af1a3ffa50 100644 --- a/modules/mem/mod_plainmem.c +++ b/modules/mem/mod_plainmem.c @@ -192,6 +192,7 @@ static const ap_slotmem_storage_method storage = { &slotmem_do, &slotmem_create, &slotmem_attach, + &slotmem_mem, &slotmem_get, &slotmem_put, &slotmem_num_slots, diff --git a/modules/mem/mod_sharedmem.c b/modules/mem/mod_sharedmem.c index c7113041cf..9020669020 100644 --- a/modules/mem/mod_sharedmem.c +++ b/modules/mem/mod_sharedmem.c @@ -555,6 +555,7 @@ static const ap_slotmem_storage_method storage = { &slotmem_do, &slotmem_create, &slotmem_attach, + &slotmem_mem, &slotmem_get, &slotmem_put, &slotmem_num_slots, diff --git a/server/slotmem.c b/server/slotmem.c index d7ddd06760..2517e2f934 100644 --- a/server/slotmem.c +++ b/server/slotmem.c @@ -56,6 +56,12 @@ AP_DECLARE(apr_status_t) ap_slotmem_attach(ap_slotmem_storage_method *sm, return (sm->slotmem_attach(new, name, item_size, item_num, pool)); } +AP_DECLARE(apr_status_t) ap_slotmem_mem(ap_slotmem_storage_method *sm, + ap_slotmem_t *s, unsigned int item_id, void**mem) +{ + return (sm->slotmem_mem(s, item_id, mem)); +} + AP_DECLARE(apr_status_t) ap_slotmem_get(ap_slotmem_storage_method *sm, ap_slotmem_t *s, unsigned int item_id, unsigned char *dest, apr_size_t dest_len) -- 2.40.0