1 /* $Id: innfeed.h 7559 2006-08-28 02:10:39Z eagle $
3 ** innfeed's configuration values.
5 ** Written by James Brister <brister@vix.com>
7 ** The application configuration values. This file is #include'd before any
8 ** system header files, so it can't rely on any CPP symbols other that what
9 ** the compiler defines.
12 #if ! defined ( innfeed_h__ )
15 #include "inn/timer.h"
17 /**********************************************************************/
18 /* Application specific defines */
19 /**********************************************************************/
21 /* the path to the run-time config file. If relative, then relative to
22 @ETCDIR@. Overridden by ``-c'' option. */
23 #define CONFIG_FILE "innfeed.conf"
27 * This next section contains things than can be overriden in the config
28 * file. The strings inside each comment is the key used in the
29 * innfeed.conf file to override the value here. See innfeed.conf for a
30 * description of each./
34 #define TAPE_DIRECTORY "innfeed" /* [pathspool]/backlog-directory */
35 #define TAPE_HIGHWATER 5 /* backlog-highwater */
36 #define TAPE_ROTATE_PERIOD 60 /* backlog-rotate-period */
37 #define TAPE_CHECKPOINT_PERIOD 30 /* backlog-ckpt-period */
38 #define TAPE_NEWFILE_PERIOD 600 /* backlog-newfile-period */
39 #define TAPE_DISABLE false /* no-backlog */
42 #define PID_FILE "innfeed.pid" /* [pathrun]/pid-file */
43 #define LOG_FILE "innfeed.log" /* [pathlog]/log-file */
46 #define DNS_RETRY_PERIOD 900 /* dns-retry */
47 #define DNS_EXPIRE_PERIOD 86400 /* dns-expire */
48 #define CLOSE_PERIOD (60 * 60 * 24) /* close-period */
49 #define GEN_HTML false /* gen-html */
50 #define INNFEED_STATUS "innfeed.status" /* status-file */
51 #define LOG_CONNECTION_STATS 0 /* connection-stats */
52 #define HOST_HIGHWATER 10 /* host-highwater */
53 #define STATS_PERIOD (60 * 10) /* stats-period */
54 #define STATS_RESET_PERIOD (60 * 60 * 12) /* stats-reset-period */
56 #define ARTTOUT 600 /* article-timeout */
57 #define RESPTOUT 300 /* response-timeout */
58 #define INIT_CXNS 1 /* initial-connections */
59 #define MAX_CXNS 2 /* max-connections */
60 #define MAX_Q_SIZE 5 /* max-queue-size */
61 #define STREAM true /* streaming */
62 #define NOCHECKHIGH 95.0 /* no-check-high */
63 #define NOCHECKLOW 90.0 /* no-check-low */
64 #define PORTNUM 119 /* port-number */
65 #define FORCE_IPv4 false /* force using IPv4 */
66 #define BLOGLIMIT 0 /* backlog-limit */
67 #define LIMIT_FUDGE 1.10 /* backlog-factor */
68 #define BLOGLIMIT_HIGH 0 /* backlog-limit-high */
70 #define INIT_RECON_PER 30 /* initial-reconnect-time */
71 #define MAX_RECON_PER (60 * 60 * 1)/* max-reconnect-time */
79 /****************************************************************************/
81 * The rest below are not run-time configurable.
84 /* If this file exists at startup then it's the same as having done
85 '-d 1' on the command line. This is a cheap way of avoiding continual
86 reloading of the newsfeeds file when debugging. */
87 #define DEBUG_FILE "innfeed.debug" /* Relative to pathlog */
89 /* if defined to a non-zero number, then a snapshot will be printed
90 whenever die() is called (e.g. on assert failure). This can use up a
92 #define SNAPSHOT_ON_DIE 0
94 /* the full pathname of the file to get a printed dump of the system when
95 a SIGINT is delivered (or SNAPSHOT_ON_DIE is non-zero--see below). */
96 #define SNAPSHOT_FILE "innfeed.snapshot" /* Relative to pathlog */
98 /* Define this be an existing directory (or NULL). If innfeed deliberatly
99 dumps core it will chdir() to this directory first (if non-NULL). If
100 NULL then it will chdir to TAPE_DIRECTORY (as possibly modified by
102 #define CORE_DIRECTORY NULL
104 /* strings that get added to the end of a peer name for generating
105 backlog file names. A peername cannot end in any of these string
106 (e.g. having a peer called 'mypeer.input' will not work) */
107 #define OUTPUT_TAIL ".output"
108 #define INPUT_TAIL ".input"
109 #define LOCK_TAIL ".lock"
111 /* rough estimate of average article line length (including
112 headers). Smaller number means more efficient article preparation (for
113 transfer), but, if much smaller than reality, then more memory
115 #define CHARS_PER_LINE 60
117 /* How many seconds between logging statistics on article allocation.
118 For no logging set to 0 */
119 #define ARTICLE_STATS_PERIOD (10 * 60) /* 10 minutes */
121 /* max number of parallel connections to a single remote. This is just a
122 sanity check for the runtime config file. */
123 #define MAX_CONNECTION_COUNT 50
125 /* default size in bytes for buffers */
126 #define BUFFER_SIZE 256
128 /* amount we expand buffers on partial reads */
129 #define BUFFER_EXPAND_AMOUNT 128
131 /* minimum number of seconds between log messages for starting
132 spooling. i.e. if the connection bounces up and down this will prevent
133 frequent logging of the spooling message. 0 turns off this logging. */
134 #define SPOOL_LOG_PERIOD 600
136 /* some big numbers just for sanity checking */
137 #define MAX_MAXCHECKS 10000 /* no more than 10000 articles at a time */
138 #define MAX_MAXART_TOUT 86400 /* one day max between articles from inn */
139 #define MAX_RESP_TOUT 3600 /* one hour max to wait for response */
141 /* the check / no-check filter value, i.e. roughly how many past
142 articles we take into account whilst doing the average for
143 check / no-check mode.
144 Ensure it's a float. */
145 #define FILTERVALUE 50.0
147 /* the maximum number of peers we'll handle (not connections) */
148 #define MAX_HOSTS 100
150 /* We try to keep article memory allocation below this limit. Doesn't work
151 very well, though. */
152 #define SOFT_ARTICLE_BYTE_LIMIT (1024 * 1024 * 10) /* 10MB */
154 /* define SELECT_RATIO to the number of times through the main loop before
155 checking on the fd from inn again.... */
156 #define SELECT_RATIO 3
159 #if defined (DBTIMES)
161 /* some small values for testing things. */
164 #define STATS_PERIOD 30 /* 30 seconds */
166 #undef STATS_RESET_PERIOD
167 #define STATS_RESET_PERIOD (6 * 60) /* 6 minutes */
169 #undef ARTICLE_STATS_PERIOD
170 #define ARTICLE_STATS_PERIOD (6 * 60) /* 7 minutes */
173 #define CLOSE_PERIOD (3 * 60) /* 5 minutes */
178 /* Additional OS-specific defines. These should really be moved into
179 configure at some point. */
181 /* Some broken system (all SunOS versions) have a lower limit for the
182 maximum number of stdio files that can be open, than the limit of open
183 file the OS will let you have. If this value is > 0 (and ``stdio-fdmax''
184 is *not* used in the config file), then all non-stdio file descriptors
185 will be kept above this value (by dup'ing them). */
187 # if defined (__SVR4)
188 # define MAX_STDIO_FD 256
190 # define MAX_STDIO_FD 128
193 # define MAX_STDIO_FD 0
196 /* some timer constants */
198 typedef enum { TMR_IDLE = TMR_APPLICATION, TMR_BACKLOGSTATS,
199 TMR_STATUSFILE, TMR_NEWARTICLE, TMR_READART, TMR_PREPART, TMR_READ,
200 TMR_WRITE, TMR_CALLBACK, TMR_MAX
203 #endif /* innfeed_h__ */