Clarify FastCgiExternalServer filename use
[mod_fastcgi.git] / mod_fastcgi.h
blob8b3c38c8aa212f81105730d46368ee780a41bddf
1 /*
2 * $Id: mod_fastcgi.h,v 1.29 2000/08/23 12:21:14 robs Exp $
3 */
5 #ifndef MOD_FASTCGI_H
6 #define MOD_FASTCGI_H
8 #define MOD_FASTCGI_VERSION "2.2.8"
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 #define FCGI_DEFAULT_LISTEN_Q 100 /* listen queue (backlog) depth */
24 #define FCGI_DEFAULT_RESTART_DELAY 5 /* delay between restarts */
25 #define DEFAULT_INIT_START_DELAY 1 /* delay between starts */
26 #define FCGI_DEFAULT_PRIORITY 0 /* process priority - not used */
27 #define FCGI_MIN_EXEC_RETRY_DELAY 10 /* minimum number of seconds to
28 wait before restarting */
29 #define MAX_INIT_ENV_VARS 64 /* max # of -initial-env options */
31 /* max number of chars in a line of stderr we can handle from a FastCGI Server */
32 #define FCGI_SERVER_MAX_STDERR_LINE_LEN 1023
34 /* size of the buffer the PM uses to read records from the request handlers */
35 #define FCGI_MSGS_BUFSIZE 32 * 512
37 #define SERVER_BUFSIZE 8192
39 /* Dynamic FastCGI applications */
40 #define FCGI_DEFAULT_MAX_PROCS 50 /* maximum number of processes that
41 * are allowed to run on system */
42 #define FCGI_DEFAULT_MIN_PROCS 5 /* minimum number of processes that
43 * can be run without being killed
44 * off by the process manager */
45 #define FCGI_DEFAULT_MAX_CLASS_PROCS 10 /* maximum number of processes that
46 * are allowed to run for a single
47 * application class */
48 #define FCGI_DEFAULT_KILL_INTERVAL 300 /* number of seconds in which we
49 * should execute the kill policy
50 * by killing off extra instances */
51 #define FCGI_DEFAULT_UPDATE_INTERVAL 300 /* number of seconds in which we
52 * should recalculate the value of
53 * totalConnTime variable */
54 #define FCGI_DEFAULT_GAIN 0.5 /* value used as an exponent in the
55 * calculation of the exponentially
56 * decayed connection times;
57 * old values are scaled by
58 * (1-dynamicGain), so making it
59 * smaller weights them more heavily
60 * compared to the current value,
61 * which is scaled by dynamicGain */
62 #define FCGI_DEFAULT_THRESHHOLD_1 0 /* if load falls below this value
63 * and we have only one instance
64 * running, it is killed off */
65 #define FCGI_DEFAULT_THRESHHOLD_N 50 /* if load falls below this value
66 * and we have more than one
67 * instances, one is killed off */
68 #define FCGI_DEFAULT_START_PROCESS_DELAY 3 /* specifies the maximum number of
69 * seconds a server should wait in
70 * attempt to connect to fcgi app
71 * before sending CONN_TIMEOUT */
74 * # of sec to wait in a non-blocking connect() to the FastCGI application
75 * before aborting the request, or 0 to indicate that blocking connect()s
76 * should be used. Non-blocking connect()s are problematic on many platforms.
78 #define FCGI_DEFAULT_APP_CONN_TIMEOUT 0
80 #define FCGI_DEFAULT_PROCESS_SLACK 5 /* if this number combined with the
81 * number of the currently running
82 * processes exceeds dynamicMaxProcs, then
83 * the KillDynamicProcs() is invoked */
84 #define FCGI_DEFAULT_RESTART_DYNAMIC 0 /* Do not restart dynamic processes */
85 #define FCGI_DEFAULT_AUTOUPDATE 0 /* do not automatically restart
86 * fcgi apps when the binary on the
87 * disk is changed. */
89 #ifdef WIN32
90 #define DEFAULT_SOCK_DIR "\\\\.\\pipe\\FastCGI\\"
91 #else
92 #define DEFAULT_SOCK_DIR "/tmp/fcgi" /* Default dir for Unix/Domain sockets */
93 #endif
95 #define FCGI_MAGIC_TYPE "application/x-httpd-fcgi"
97 #if defined(PATH_MAX)
98 #define FCGI_MAXPATH PATH_MAX
99 #elif defined(MAXPATHLEN)
100 #define FCGI_MAXPATH MAXPATHLEN
101 #else
102 #define FCGI_MAXPATH 512
103 #endif
105 /* REQ_COMPLETE is the longest: id, path, user, gid, qtime, start */
106 #define FCGI_MSG_CRAP 1 + 2 + MAX_USER_NAME_LEN + 1 + MAX_GID_CHAR_LEN + (2 * 11) + 3
108 #if defined(PIPE_BUF) && PIPE_BUF < FCGI_MAXPATH + FCGI_MSG_CRAP
109 #define FCGI_MAX_MSG_LEN PIPE_BUF
110 #undef FCGI_MAXPATH
111 #define FCGI_MAXPATH PIPE_BUF - FCGI_MSG_CRAP
112 #else
113 #define FCGI_MAX_MSG_LEN FCGI_MAXPATH + FCGI_MSG_CRAP
114 #endif
116 /* There is no way to reliably determiine the highest descriptor that can be
117 * assigned (UNP Vol1 Ed2 p337, and APUE p43) so we pick a number. */
118 #if (defined FD_SETSIZE) && (FD_SETSIZE > 1024)
119 #define FCGI_MAX_FD FD_SETSIZE
120 #else
121 #define FCGI_MAX_FD 1024
122 #endif
124 #ifndef SUN_LEN
125 #define SUN_LEN(sock) \
126 (sizeof(*(sock)) - sizeof((sock)->sun_path) + strlen((sock)->sun_path))
127 #endif
129 #if defined MAXLOGNAME && MAXLOGNAME > 15
130 #define MAX_USER_NAME_LEN MAXLOGNAME
131 #elif defined UT_NAMESIZE && UT_NAMESIZE > 15
132 #define MAX_USER_NAME_LEN UT_NAMESIZE
133 #else
134 #define MAX_USER_NAME_LEN 15 /* Max len of user name (suexec w/ ~user), */
135 #endif /* must accomodate uid printed as %ld too */
136 #define MAX_GID_CHAR_LEN 15 /* Max #chars in a gid printed as %ld */
138 #ifndef TRUE
139 #define TRUE (1)
140 #endif
142 #ifndef FALSE
143 #define FALSE (0)
144 #endif
146 #ifndef min
147 #define min(a,b) ((a) < (b) ? (a) : (b))
148 #endif
150 #ifndef max
151 #define max(a,b) ((a) > (b) ? (a) : (b))
152 #endif
154 /* This is (more or less) from http_main.c. It should be in an Apache header */
155 #ifndef SYS_SIGLIST
156 #define SYS_SIGLIST ap_sys_siglist
157 extern const char *ap_sys_siglist[];
158 #endif
160 #endif /* MOD_FASTCGI_H */