Apache HTTPD
ap_socache.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
26#ifndef AP_SOCACHE_H
27#define AP_SOCACHE_H
28
29#include "httpd.h"
30#include "ap_provider.h"
31#include "apr_pools.h"
32#include "apr_time.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
43/* XXX: Even if store/retrieve/remove is atomic, isn't it useful to note
44 * independently that status and iterate may or may not be?
45 */
46#define AP_SOCACHE_FLAG_NOTMPSAFE (0x0001)
47
50
61
79 void *userctx,
80 const unsigned char *id,
81 unsigned int idlen,
82 const unsigned char *data,
83 unsigned int datalen,
85
89typedef struct ap_socache_provider_t {
91 const char *name;
92
94 unsigned int flags;
95
109 const char *(*create)(ap_socache_instance_t **instance, const char *arg,
110 apr_pool_t *tmp, apr_pool_t *p);
111
128 apr_status_t (*init)(ap_socache_instance_t *instance, const char *cname,
129 const struct ap_socache_hints *hints,
131
138
152 const unsigned char *id, unsigned int idlen,
153 apr_time_t expiry,
154 unsigned char *data, unsigned int datalen,
156
172 const unsigned char *id, unsigned int idlen,
173 unsigned char *data, unsigned int *datalen,
175
186 const unsigned char *id, unsigned int idlen,
188
198 void (*status)(ap_socache_instance_t *instance, request_rec *r, int flags);
199
212 void *userctx, ap_socache_iterator_t *iterator,
214
216
218#define AP_SOCACHE_PROVIDER_GROUP "socache"
220#define AP_SOCACHE_PROVIDER_VERSION "0"
221
223#define AP_SOCACHE_DEFAULT_PROVIDER "default"
224
225#ifdef __cplusplus
226}
227#endif
228
229#endif /* AP_SOCACHE_H */
Apache Provider API.
APR memory allocation.
APR Time Library.
request_rec * r
void const char * arg
Definition http_vhost.h:63
apr_status_t() ap_socache_iterator_t(ap_socache_instance_t *instance, server_rec *s, void *userctx, const unsigned char *id, unsigned int idlen, const unsigned char *data, unsigned int datalen, apr_pool_t *pool)
Definition ap_socache.h:77
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
void * data
const char apr_uint32_t * id
const char * s
Definition apr_strings.h:95
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
apr_int64_t apr_time_t
Definition apr_time.h:45
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
apr_size_t avg_id_len
Definition ap_socache.h:55
apr_size_t avg_obj_size
Definition ap_socache.h:57
apr_interval_time_t expiry_interval
Definition ap_socache.h:59
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)
Definition ap_socache.h:151
unsigned int flags
Definition ap_socache.h:94
void(* status)(ap_socache_instance_t *instance, request_rec *r, int flags)
Definition ap_socache.h:198
const char * name
Definition ap_socache.h:91
apr_status_t(* remove)(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_pool_t *pool)
Definition ap_socache.h:185
apr_status_t(* iterate)(ap_socache_instance_t *instance, server_rec *s, void *userctx, ap_socache_iterator_t *iterator, apr_pool_t *pool)
Definition ap_socache.h:211
void(* destroy)(ap_socache_instance_t *instance, server_rec *s)
Definition ap_socache.h:137
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)
Definition ap_socache.h:128
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)
Definition ap_socache.h:171
A structure that represents the current request.
Definition httpd.h:845
A structure to store information for each virtual server.
Definition httpd.h:1322