remove a couple of debug lines
[mod_fastcgi.git] / mod_fastcgi.h
blob5b1685409b37ea070fb48aad98fd367382d4c5dc
1 /*
2 * $Id: mod_fastcgi.h,v 1.40 2002/02/28 15:58:11 robs Exp $
3 */
5 #ifndef MOD_FASTCGI_H
6 #define MOD_FASTCGI_H
8 #define MOD_FASTCGI_VERSION "2.2.13"
11 * # of idle seconds allowed to pass while connected to a FastCGI before aborting
13 #define FCGI_DEFAULT_IDLE_TIMEOUT 30
16 * (WIN32) # of sec to wait while trying to connect using a named pipe.
17 * This is overridden by -appConnTimeout, if set. This value is similiar
18 * to the OS specific (blocking) connect() timeout. According to XXX
19 * this is typically XXX sec.
21 #define FCGI_NAMED_PIPE_CONNECT_TIMEOUT 90
23 /*
24 * [WIN32] The number of millisecs to wait after having signaled the
25 * termination event to its applications before issuing a TerminateProcess().
26 * If all of the applications are based on a version of the FastCGI
27 * application library that properly handles the shutdown event
28 * (fcgi2 v2.2.4), this can be set to <= 0 to prevent the use of
29 * TerminateProcess() entirely. If non of the applications support the
30 * termination event, this value can be set to 1. It is highly reccomended
31 * that the termination event be supported, as TerminateProcess() is a
32 * brutal way of taking down an application.
34 #define WIN32_SHUTDOWN_GRACEFUL_WAIT 1000
36 #define FCGI_DEFAULT_LISTEN_Q 100 /* listen queue (backlog) depth */
37 #define FCGI_DEFAULT_RESTART_DELAY 5 /* delay between restarts */
38 #define DEFAULT_INIT_START_DELAY 1 /* delay between starts */
39 #define FCGI_DEFAULT_PRIORITY 0 /* process priority - not used */
40 #define FCGI_MIN_EXEC_RETRY_DELAY 10 /* minimum number of seconds to
41 wait before restarting */
42 #define MAX_INIT_ENV_VARS 64 /* max # of -initial-env options */
44 /* max number of chars in a line of stderr we can handle from a FastCGI Server */
45 #define FCGI_SERVER_MAX_STDERR_LINE_LEN 1023
47 /* size of the buffer the PM uses to read records from the request handlers */
48 #define FCGI_MSGS_BUFSIZE 32 * 512
50 #define SERVER_BUFSIZE 8192
52 /* Dynamic FastCGI applications */
53 #define FCGI_DEFAULT_MAX_PROCS 50 /* maximum number of processes that
54 * are allowed to run on system */
55 #define FCGI_DEFAULT_MIN_PROCS 5 /* minimum number of processes that
56 * can be run without being killed
57 * off by the process manager */
58 #define FCGI_DEFAULT_MAX_CLASS_PROCS 10 /* maximum number of processes that
59 * are allowed to run for a single
60 * application class */
61 #define FCGI_DEFAULT_KILL_INTERVAL 300 /* number of seconds in which we
62 * should execute the kill policy
63 * by killing off extra instances */
64 #define FCGI_DEFAULT_UPDATE_INTERVAL 300 /* number of seconds in which we
65 * should recalculate the value of
66 * totalConnTime variable */
67 #define FCGI_DEFAULT_GAIN 0.5 /* value used as an exponent in the
68 * calculation of the exponentially
69 * decayed connection times;
70 * old values are scaled by
71 * (1-dynamicGain), so making it
72 * smaller weights them more heavily
73 * compared to the current value,
74 * which is scaled by dynamicGain */
75 #define FCGI_DEFAULT_THRESHOLD_1 0 /* if load falls below this value
76 * and we have only one instance
77 * running, it is killed off */
78 #define FCGI_DEFAULT_THRESHOLD_N 50 /* if load falls below this value
79 * and we have more than one
80 * instances, one is killed off */
81 #define FCGI_DEFAULT_START_PROCESS_DELAY 3 /* specifies the maximum number of
82 * seconds a server should wait in
83 * attempt to connect to fcgi app
84 * before sending FCGI_REQUEST_TIMEOUT_JOB */
87 * # of sec to wait in a non-blocking connect() to the FastCGI application
88 * before aborting the request, or 0 to indicate that blocking connect()s
89 * should be used. Non-blocking connect()s are problematic on many platforms.
91 #define FCGI_DEFAULT_APP_CONN_TIMEOUT 0
93 #define FCGI_DEFAULT_PROCESS_SLACK 5 /* if this number combined with the
94 * number of the currently running
95 * processes exceeds dynamicMaxProcs, then
96 * the KillDynamicProcs() is invoked */
97 #define FCGI_DEFAULT_RESTART_DYNAMIC 0 /* Do not restart dynamic processes */
98 #define FCGI_DEFAULT_AUTOUPDATE 0 /* do not automatically restart
99 * fcgi apps when the binary on the
100 * disk is changed. */
103 * Should data recieved from the FastCGI server be immediately flushed to
104 * the client? Default: FALSE
106 #define FCGI_FLUSH FALSE
108 #ifdef WIN32
110 /* # of millisecs to wait on the mbox mutex */
111 #define FCGI_MBOX_MUTEX_TIMEOUT 5000
113 #define DEFAULT_SOCK_DIR "\\\\.\\pipe\\FastCGI\\"
115 #else /* ! WIN32 */
117 #define DEFAULT_SOCK_DIR "/tmp/fcgi" /* Default dir for Unix/Domain sockets */
119 #endif /* ! WIN32 */
121 #define FCGI_MAGIC_TYPE "application/x-httpd-fcgi"
123 #if defined(PATH_MAX)
124 #define FCGI_MAXPATH PATH_MAX
125 #elif defined(MAXPATHLEN)
126 #define FCGI_MAXPATH MAXPATHLEN
127 #else
128 #define FCGI_MAXPATH 512
129 #endif
131 /* FCGI_REQUEST_COMPLETE_JOB is the longest: id, path, user, gid, qtime, start */
132 #define FCGI_MSG_CRAP 1 + 2 + MAX_USER_NAME_LEN + 1 + MAX_GID_CHAR_LEN + (2 * 11) + 3
134 #if defined(PIPE_BUF) && PIPE_BUF < FCGI_MAXPATH + FCGI_MSG_CRAP
135 #define FCGI_MAX_MSG_LEN PIPE_BUF
136 #undef FCGI_MAXPATH
137 #define FCGI_MAXPATH PIPE_BUF - FCGI_MSG_CRAP
138 #else
139 #define FCGI_MAX_MSG_LEN FCGI_MAXPATH + FCGI_MSG_CRAP
140 #endif
142 /* There is no way to reliably determiine the highest descriptor that can be
143 * assigned (UNP Vol1 Ed2 p337, and APUE p43) so we pick a number. */
144 #if (defined FD_SETSIZE) && (FD_SETSIZE > 1024)
145 #define FCGI_MAX_FD FD_SETSIZE
146 #else
147 #define FCGI_MAX_FD 1024
148 #endif
150 #ifndef SUN_LEN
151 #define SUN_LEN(sock) \
152 (sizeof(*(sock)) - sizeof((sock)->sun_path) + strlen((sock)->sun_path))
153 #endif
155 #if defined MAXLOGNAME && MAXLOGNAME > 15
156 #define MAX_USER_NAME_LEN MAXLOGNAME
157 #elif defined UT_NAMESIZE && UT_NAMESIZE > 15
158 #define MAX_USER_NAME_LEN UT_NAMESIZE
159 #else
160 #define MAX_USER_NAME_LEN 15 /* Max len of user name (suexec w/ ~user), */
161 #endif /* must accomodate uid printed as %ld too */
162 #define MAX_GID_CHAR_LEN 15 /* Max #chars in a gid printed as %ld */
164 #ifndef TRUE
165 #define TRUE (1)
166 #endif
168 #ifndef FALSE
169 #define FALSE (0)
170 #endif
172 #ifndef min
173 #define min(a,b) ((a) < (b) ? (a) : (b))
174 #endif
176 #ifndef max
177 #define max(a,b) ((a) > (b) ? (a) : (b))
178 #endif
180 /* This is (more or less) from http_main.c. It should be in an Apache header */
181 #ifndef SYS_SIGLIST
182 #define SYS_SIGLIST ap_sys_siglist
183 extern const char *ap_sys_siglist[];
184 #endif
186 #endif /* MOD_FASTCGI_H */