2 * mod_crccache_client.h
4 * Created on: 15/03/2009
8 #ifndef MOD_CRCCACHE_CLIENT_H
9 #define MOD_CRCCACHE_CLIENT_H
11 #include "cache/cache.h"
13 #include <ap_config.h>
14 #include <http_config.h>
15 #include <apr_optional.h>
18 extern module AP_MODULE_DECLARE_DATA crccache_client_module
;
20 const char* cache_create_key( request_rec
*r
);
22 APR_DECLARE_OPTIONAL_FN(apr_status_t
,
23 ap_cache_generate_key
,
24 (request_rec
*r
, apr_pool_t
*p
, char**key
));
26 extern APR_OPTIONAL_FN_TYPE(ap_cache_generate_key
) *cache_generate_key
;
30 #define FULL_BLOCK_COUNT 40
32 typedef enum decoding_state
{
35 DECODING_LITERAL_BODY
,
36 DECODING_LITERAL_SIZE
,
38 DECODING_BLOCK_HEADER
,
43 DECOMPRESSION_INITIALIZED
,
45 } decompression_state_t
;
47 typedef struct crccache_client_ctx_t
{
48 apr_bucket_brigade
*bb
;
50 size_t tail_block_size
;
51 apr_bucket
* cached_bucket
;// original data so we can fill in the matched blocks
54 decompression_state_t decompression_state
;
55 z_stream
*decompression_stream
;
57 struct apr_sha1_ctx_t sha1_ctx
;
58 unsigned char sha1_value_rx
[APR_SHA1_DIGESTSIZE
];
60 unsigned literal_size
;
61 unsigned char * partial_literal
;// original data so we can fill in the matched blocks
62 } crccache_client_ctx
;
70 struct cache_disable
{
75 /* static information about the local cache */
78 apr_array_header_t
*cacheenable
; /* URLs to cache */
79 apr_array_header_t
*cachedisable
; /* URLs not to cache */
82 const char* cache_root
;
83 apr_size_t cache_root_len
;
84 int dirlevels
; /* Number of levels of subdirectories */
85 int dirlength
; /* Length of subdirectory names */
86 apr_off_t minfs
; /* minimum file size for cached files */
87 apr_off_t maxfs
; /* maximum file size for cached files */
88 } crccache_client_conf
;
90 #endif /*MOD_CRCCACHE_CLIENT_H*/