1 #ifndef CONFIG_H
2 #define CONFIG_H
3 
4 /* url for web interface */
5 #define INTERFACEURL "mman"
6 
7 /* maximum listening ports allowed */
8 #define MAXLISTENPORTS 20
9 
10 /* maximum threads (thus, maximum connections) */
11 #define MAXTHREADS 1024
12 
13 /* file mask for mkstemp */
14 #define TEMPMASK "mmanXXXXXX"
15 
16 /* time in seconds to hold dns results in cache before purging */
17 #define DNS_EXPIRE 360
18 
19 /* size of hashtable for cached dns results */
20 #define DNS_HASH_SIZE 8111
21 
22 /* default size of connection pool */
23 #define POOL_SIZE 24
24 
25 /* timeout until a pooled connection is closed */
26 #define POOL_TIMEOUT 120
27 
28 /* thread stack size */
29 #define STACKSIZE 65536
30 
31 /* flags for regcomp */
32 #define REGFLAGS REG_EXTENDED | REG_ICASE | REG_NOSUB
33 
34 /* flags for pcre_compile */
35 #define PCREFLAGS PCRE_CASELESS | PCRE_DOTALL | PCRE_MULTILINE
36 
37 /* format of log timestamps, see strftime manpage for help */
38 #define TIMEFORMAT "%a %d %H:%M:%S"
39 
40 /* format of time in HTTP headers (i.e. "Thu, 01 Dec 1994 16:00:00 GMT") */
41 #define HTTPTIMEFORMAT "%a, %d %b %Y %T GMT"
42 
43 /* maximum substrings for regexp's with backreferences (rewrite rules) */
44 #define PCRE_MAX_SUBSTRING 16
45 
46 /* filebuf size will always be aligned to a multiple of this number, must be a power of 2.
47    this reduces overhead due to excessive realloc'ing */
48 #define FILEBUF_ALIGNMENT 65536
49 
50 /* same as above, except for cache files */
51 #define CACHE_ALIGNMENT 65536
52 
53 /* size of blocks to read/write at once */
54 #define BLOCKSIZE 8096
55 
56 /* default number of log entries to keep in memory for web interface */
57 #define LOGBUFFERSIZE 1000
58 
59 /* mask of log entry types to _NOT_ show on the web interface */
60 #define LOGMASK MMLOG_DEBUG
61 
62 /* the number of lines after a changed area that must match before considering it the end of the changed area
63    when displaying the changes made by rewrite rules to a file */
64 #define DIFF_HUNK 3
65 
66 /* default HTTP port */
67 #define HTTP_PORT 80
68 
69 /* default HTTPS port */
70 #define HTTPS_PORT 443
71 
72 /* default FTP port */
73 #define FTP_PORT 21
74 
75 /* cache hash table size */
76 #define CACHEMAP_HASH_SIZE 19997
77 
78 /* htmlstream callback hash table size */
79 #define HSTREAM_HASH_SIZE 16
80 
81 /* default anonymous ftp login */
82 #define ANONLOGIN "anonymous"
83 
84 /* default anonymous ftp password */
85 #define ANONPASS "noone@nowhere.com"
86 
87 /* maximum level of nesting in HTML parser */
88 #define HTML_NESTING_LIMIT 64
89 
90 /* the User-Agent string when prefetching */
91 #define PREFETCH_USERAGENT "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)"
92 
93 /* minimum interval between cache evictions */
94 #define CLEAN_INTERVAL 30
95 
96 /* the number of cache journal entries before the journal file is rewritten */
97 #define JOURNAL_SIZE 128000
98 
99 /* the fraction of the delta between the oldest and newest cache file the threshold is
100    incremented by on each pass when evicting the cache */
101 #define CACHE_INCREMENT_FRACTION 16
102 
103 /* encoding types the proxy can accept */
104 #define ACCEPTED_ENCODINGS "gzip, deflate"
105 
106 /* thread timeout when awaiting another connection to handle */
107 #define THREAD_TIMEOUT 10
108 
109 /* web interface colours */
110 #define INTERFACE_BG "#99AABB" /* background */
111 #define INTERFACE_TEXT "#000000" /* text */
112 #define INTERFACE_LINK "#0000FF" /* link */
113 #define INTERFACE_VLINK "#0000FF" /* visited link */
114 #define INTERFACE_TABLEBG "#DDEEFF" /* table background */
115 #define INTERFACE_TABLEBORDER "#99AABB" /* table border */
116 
117 /* maximum number of proxies to send ICP queries to at a time */
118 #define ICP_PEERS_MAX 100
119 
120 /* default ICP timeout (milliseconds) */
121 #define ICP_TIMEOUT 1000
122 
123 #endif				/* CONFIG_H */
124