diff options
author | Jeff Trawick <trawick@apache.org> | 2009-03-25 09:30:18 +0100 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2009-03-25 09:30:18 +0100 |
commit | 9db133b4a8dbcf3af10ff5d9e3dda4608d44f378 (patch) | |
tree | 130132321704a2866549e7822324a51abfb318c7 /include | |
parent | * Teach apxs to work with APR 2.x where there is no separate APR-UTIL (diff) | |
download | apache2-9db133b4a8dbcf3af10ff5d9e3dda4608d44f378.tar.xz apache2-9db133b4a8dbcf3af10ff5d9e3dda4608d44f378.zip |
Provide ap_set_retained_data()/ap_get_retained_data() for preservation
of module state across unload/load.
The existing idiom used by modules to associate userdata with pglobal
doesn't work in the earliest phases of module execution.
(This does expose pglobal as an implementation detail, but it would be great
to unexpose it if at all possible (but modules already have access to pglobal
at almost all stages of execution anyway).)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758173 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/ap_mmn.h | 3 | ||||
-rw-r--r-- | include/http_config.h | 15 | ||||
-rw-r--r-- | include/http_main.h | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 8c003d28bb..aaaff2e456 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -189,6 +189,7 @@ * 20090130.0 (2.3.2-dev) Add ap_ prefix to unixd_setup_child(). * 20090131.0 (2.3.2-dev) Remove ap_default_type(), disable DefaultType * 20090208.0 (2.3.2-dev) Add conn_rec::current_thread. + * 20090208.1 (2.3.3-dev) Add ap_set_retained_data()/ap_get_retained_data() */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ @@ -196,7 +197,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20090208 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/http_config.h b/include/http_config.h index cba626ea58..6ad9087046 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -915,6 +915,21 @@ AP_DECLARE(int) ap_process_config_tree(server_rec *s, apr_pool_t *p, apr_pool_t *ptemp); +/** + * Store data which will be retained across unload/load of modules + * @param key The unique key associated with this module's retained data + * @param Size in bytes of the retained data (to be allocated) + * @return Address of new retained data structure, initially cleared + */ +AP_DECLARE(void *) ap_set_retained_data(const char *key, apr_size_t size); + +/** + * Retrieve data which was stored by ap_set_retained_data() + * @param key The unique key associated with this module's retained data + * @return Address of previously retained data structure, or NULL if not yet saved + */ +AP_DECLARE(void *) ap_get_retained_data(const char *key); + /* Module-method dispatchers, also for http_request.c */ /** * Run the handler phase of each module until a module accepts the diff --git a/include/http_main.h b/include/http_main.h index 545ba5ac13..dc0a0de61b 100644 --- a/include/http_main.h +++ b/include/http_main.h @@ -45,6 +45,8 @@ AP_DECLARE_DATA extern const char *ap_server_argv0; AP_DECLARE_DATA extern const char *ap_server_root; /** The global server's server_rec */ AP_DECLARE_DATA extern server_rec *ap_server_conf; +/** global pool, for access prior to creation of server_rec */ +AP_DECLARE_DATA extern apr_pool_t *ap_pglobal; /* for -C, -c and -D switches */ /** An array of all -C directives. These are processed before the server's |