Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
35 extern "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 
60 };
61 
78  server_rec *s,
79  void *userctx,
80  const unsigned char *id,
81  unsigned int idlen,
82  const unsigned char *data,
83  unsigned int datalen,
84  apr_pool_t *pool);
85 
89 typedef 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,
130  server_rec *s, apr_pool_t *pool);
131 
138 
152  const unsigned char *id, unsigned int idlen,
153  apr_time_t expiry,
154  unsigned char *data, unsigned int datalen,
155  apr_pool_t *pool);
156 
172  const unsigned char *id, unsigned int idlen,
173  unsigned char *data, unsigned int *datalen,
174  apr_pool_t *pool);
175 
186  const unsigned char *id, unsigned int idlen,
187  apr_pool_t *pool);
188 
199 
212  void *userctx, ap_socache_iterator_t *iterator,
213  apr_pool_t *pool);
214 
216 
218 #define AP_SOCACHE_PROVIDER_GROUP "socache"
219 
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 */
230 
Definition: ap_socache.h:89
size_t apr_size_t
Definition: apr.h:375
const char * name
Definition: ap_socache.h:91
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:556
Apache Provider API.
void(* destroy)(ap_socache_instance_t *instance, server_rec *s)
Definition: ap_socache.h:137
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
apr_size_t avg_obj_size
Definition: ap_socache.h:57
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_interval_time_t expiry_interval
Definition: ap_socache.h:59
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
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
unsigned int flags
Definition: ap_socache.h:94
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
apr_int64_t apr_time_t
Definition: apr_time.h:45
APR memory allocation.
HTTP Daemon routines.
void(* status)(ap_socache_instance_t *instance, request_rec *r, int flags)
Definition: ap_socache.h:198
A structure to store information for each virtual server.
Definition: httpd.h:1302
struct ap_socache_provider_t ap_socache_provider_t
apr_pool_t * p
A structure that represents the current request.
Definition: httpd.h:805
Definition: ap_socache.h:53
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
typedef void(APR_THREAD_FUNC *PFN_HSE_IO_COMPLETION)(EXTENSION_CONTROL_BLOCK *ecb
int apr_status_t
Definition: apr_errno.h:44
request_rec * r
Definition: mod_dav.h:519
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 Time Library.
apr_size_t avg_id_len
Definition: ap_socache.h:55
struct ap_socache_instance_t ap_socache_instance_t
Definition: ap_socache.h:49