1 #ifndef SERVER_H_INCLUDED
2 #define SERVER_H_INCLUDED
6 #include "xmlrpc-c/abyss.h"
11 typedef struct _Tsocket Tsocket;
14 abyss_bool terminationRequested;
15 /* User wants this server to terminate as soon as possible,
16 in particular before accepting any more connections and without
19 abyss_bool socketBound;
20 /* The listening socket exists and is bound to a local address
21 (may already be listening as well)
23 TSocket * listenSocketP;
24 /* Meaningful only when 'socketBound' is true: file descriptor of
25 the listening socket ("listening socket" means socket for listening,
26 not a socket that is listening right now).
28 abyss_bool weCreatedListenSocket;
29 /* We created the listen socket (whose fd is 'listensock'), as
30 opposed to 1) User supplied it; or 2) there isn't one.
32 const char * logfilename;
33 abyss_bool logfileisopen;
37 const char * filespath;
38 abyss_bool serverAcceptsConnections;
39 /* We listen for and accept TCP connections for HTTP transactions.
40 (The alternative is the user supplies a TCP-connected socket
44 /* Meaningful only when 'socketBound' is false: port number to which
45 we should bind the listening socket
47 uint32_t keepalivetimeout;
48 uint32_t keepalivemaxconn;
50 /* Maximum time in seconds the server will wait to read a header
51 or a data chunk from the socket.
54 TList defaultfilenames;
55 void * defaulthandler;
58 /* NULL means to use the global MIMEType object */
59 abyss_bool useSigchld;
60 /* Meaningless if not using forking for threads.
61 TRUE means user will call ServerHandleSigchld to indicate that
62 a SIGCHLD signal was received, and server shall use that as its
63 indication that a child has died. FALSE means server will not
64 be aware of SIGCHLD and will instead poll for existence of PIDs
65 to determine if a child has died.
76 ServerBackgroundProcessComplete(pid_t const pid);