Apache2
|
#include <ap_socache.h>
Data Fields | |
const char * | name |
unsigned int | flags |
const char *(* | create )(ap_socache_instance_t **instance, const char *arg, apr_pool_t *tmp, apr_pool_t *p) |
apr_status_t(* | init )(ap_socache_instance_t *instance, const char *cname, const struct ap_socache_hints *hints, server_rec *s, apr_pool_t *pool) |
void(* | destroy )(ap_socache_instance_t *instance, server_rec *s) |
apr_status_t(* | store )(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_time_t expiry, unsigned char *data, unsigned int datalen, apr_pool_t *pool) |
apr_status_t(* | retrieve )(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, unsigned char *data, unsigned int *datalen, apr_pool_t *pool) |
apr_status_t(* | remove )(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_pool_t *pool) |
void(* | status )(ap_socache_instance_t *instance, request_rec *r, int flags) |
apr_status_t(* | iterate )(ap_socache_instance_t *instance, server_rec *s, void *userctx, ap_socache_iterator_t *iterator, apr_pool_t *pool) |
A socache provider structure. socache providers are registered with the ap_provider.h interface using the AP_SOCACHE_PROVIDER_* constants.
const char*(* ap_socache_provider_t::create) (ap_socache_instance_t **instance, const char *arg, apr_pool_t *tmp, apr_pool_t *p) |
Create a small object cache based on the given configuration string. The instance pointer returned in the instance parameter will be passed as the first argument to subsequent invocations.
instance | Output parameter to which instance object is written. |
arg | User-specified configuration string. May be NULL to force use of defaults. |
tmp | Pool to be used for any temporary allocations |
p | Pool to be use for any allocations lasting as long as the created instance |
void(* ap_socache_provider_t::destroy) (ap_socache_instance_t *instance, server_rec *s) |
Destroy a given cache instance object.
instance | The cache instance to destroy. |
s | Associated server structure (for logging purposes) |
unsigned int ap_socache_provider_t::flags |
Bitmask of AP_SOCACHE_FLAG_* flags.
apr_status_t(* ap_socache_provider_t::init) (ap_socache_instance_t *instance, const char *cname, const struct ap_socache_hints *hints, server_rec *s, apr_pool_t *pool) |
Initialize the cache. The cname must be of maximum length 16 characters, and uniquely identifies the consumer of the cache within the server; using the module name is recommended, e.g. "mod_ssl-sess". This string may be used within a filesystem path so use of only alphanumeric [a-z0-9_-] characters is recommended. If hints is non-NULL, it gives a set of hints for the provider. Returns APR error code.
instance | The cache instance |
cname | A unique string identifying the consumer of this API |
hints | Optional hints argument describing expected cache use |
s | Server structure to which the cache is associated |
pool | Pool for long-lived allocations |
apr_status_t(* ap_socache_provider_t::iterate) (ap_socache_instance_t *instance, server_rec *s, void *userctx, ap_socache_iterator_t *iterator, apr_pool_t *pool) |
Dump all cached objects through an iterator callback.
instance | The cache instance |
s | Associated server context (for processing and logging) |
userctx | User defined pointer passed through to the iterator |
iterator | The user provided callback function which will receive individual calls for each unexpired id/data pair |
pool | Pool for temporary allocations. |
const char* ap_socache_provider_t::name |
Canonical provider name.
apr_status_t(* ap_socache_provider_t::remove) (ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_pool_t *pool) |
Remove an object from the cache
instance | The cache instance |
s | Associated server structure (for logging purposes) |
id | Unique ID for the object; binary blob |
idlen | Length of id blob |
pool | Pool for temporary allocations. |
apr_status_t(* ap_socache_provider_t::retrieve) (ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, unsigned char *data, unsigned int *datalen, apr_pool_t *pool) |
Retrieve a cached object.
instance | The cache instance |
s | Associated server structure (for logging purposes) |
id | Unique ID for the object; binary blob |
idlen | Length of id blob |
data | Output buffer to place retrievd data (binary blob) |
datalen | On entry, length of data buffer; on exit, the number of bytes written to the data buffer. |
pool | Pool for temporary allocations. |
void(* ap_socache_provider_t::status) (ap_socache_instance_t *instance, request_rec *r, int flags) |
Dump the status of a cache instance for mod_status. Will use the ap_r* interfaces to produce appropriate status output. XXX: ap_r* are deprecated, bad dogfood
instance | The cache instance |
r | The request structure |
flags | The AP_STATUS_* constants used (see mod_status.h) |
apr_status_t(* ap_socache_provider_t::store) (ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_time_t expiry, unsigned char *data, unsigned int datalen, apr_pool_t *pool) |
Store an object in a cache instance.
instance | The cache instance |
s | Associated server structure (for logging purposes) |
id | Unique ID for the object; binary blob |
idlen | Length of id blob |
expiry | Absolute time at which the object expires |
data | Data to store; binary blob |
datalen | Length of data blob |
pool | Pool for temporary allocations. |