Append crcsync-<original-encoding> to etag and some enhancements and bug fixes
[httpd-crcsyncproxy.git] / crccache / crccache.h
blob5ad2fe6fded8895f17521dbc82c6319bef655c8a
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 #define CRCCACHE_ENCODING "crcsync"
24 const char * ACCEPT_ENCODING_HEADER = "Accept-Encoding";
25 const char * ENCODING_HEADER = "Content-Encoding";
26 const char * BLOCK_HEADER = "If-Block";
27 const char * VARY_HEADER = "Vary";
28 const char * VARY_VALUE = "If-Block";
29 const char * ETAG_HEADER = "ETag";
31 const int HASH_SIZE=64; // bits per has, 30 bits is 5 bytes base 64
33 // HASH_SIZE_BYTES*FULL_BLOCK_COUNT*4/3 rounded up to the nearest multiple of 3
34 // 8*40*4/3 = 438
35 const int HASH_HEADER_SIZE=427;
38 const unsigned char ENCODING_LITERAL='L';
39 const unsigned char ENCODING_BLOCK='B';
40 const unsigned char ENCODING_COMPRESSED='Z';
41 const unsigned char ENCODING_HASH='S';
43 const int ENCODING_COMPRESSED_HEADER_SIZE = 1;// 1 byte indicator
44 const int ENCODING_LITERAL_HEADER_SIZE = 1+4;// 1 byte indicator + 4 bytes length
45 const int ENCODING_BLOCK_HEADER_SIZE = 1+1;// 1 byte indicator + 1 byte block
47 #endif /* CRCCACHE_H_ */