make module cache just about everything, but never return items
[httpd-crcsyncproxy.git] / crccache / crccache.h
blob6856d87ad64a3f61323108984aab4d9b7d4e87bc
1 /*
2 * crccache.h
4 * Common files for crccache client and server apache modules
6 * Created on: 21/02/2009
7 * Author: Toby Collett
8 * Contributor: Alex Wulms
9 */
11 #ifndef CRCCACHE_H_
12 #define CRCCACHE_H_
14 #include <stdint.h>
16 #ifndef MAX
17 #define MAX(a,b) ((a) > (b) ? (a) : (b))
18 #endif
19 #ifndef MIN
20 #define MIN(a,b) ((a) < (b) ? (a) : (b))
21 #endif
23 const char * CRCCACHE_ENCODING = "crcsync";
24 const char * ENCODING_HEADER = "Content-Encoding";
25 const char * BLOCK_HEADER = "If-Block";
26 const char * VARY_HEADER = "Vary";
27 const char * VARY_VALUE = "If-Block";
28 // hashes per file
29 #define FULL_BLOCK_COUNT 40
30 const int HASH_SIZE=64; // bits per has, 30 bits is 5 bytes base 64
32 // HASH_SIZE_BYTES*(FULL_BLOCK_COUNT+1)*4/3 rounded up to the nearest multiple of 3
33 // 8*(40+1)*4/3 = 438
34 const int HASH_HEADER_SIZE=438;
37 const unsigned char ENCODING_LITERAL='L';
38 const unsigned char ENCODING_BLOCK='B';
39 const unsigned char ENCODING_COMPRESSED='Z';
40 const unsigned char ENCODING_HASH='S';
42 const int ENCODING_COMPRESSED_HEADER_SIZE = 1;// 1 byte indicator
43 const int ENCODING_LITERAL_HEADER_SIZE = 1+4;// 1 byte indicator + 4 bytes length
44 const int ENCODING_BLOCK_HEADER_SIZE = 1+1;// 1 byte indicator + 1 byte block
46 #endif /* CRCCACHE_H_ */