Data Structures | |
struct | w3Server |
struct | w3ServerConnection |
Functions | |
char * | w3HTMLGenerateError (char *header, char *info, int pagecode) |
w3ServerConnection * | w3ServerAccept (w3Server *server) |
boolean | w3ServerInit (w3Server *server) |
boolean | w3ServerClose (w3Server *server) |
boolean | w3ServerDisconnect (w3ServerConnection *con) |
char * | w3ServerGetToken (char *str, int *idx) |
char * | w3ServerGetPath (char *str) |
boolean | w3ServerSendFile (char *path, w3ServerConnection *con) |
boolean | w3ServerSendError (int errorcode, w3ServerConnection *con) |
boolean | w3ServerServeClient (w3Server *server, w3ServerConnection *con) |
boolean | w3StartServer (int port) |
void | w3ServerMessage (const char *msg) |
|
Generates an appropriate error page. The returned pointer points to a newly created string that should be free()d after use. |
|
Accepts a connection for server server. |
|
Closes the server. |
|
Closes a connection to the server. con is deleted. |
|
Parses a "GET ..." request and returns a newly allocated char* containing the full path to the requested file. Replace this by a more general request parser. |
|
Gets the first token out of str and returns it in a newly allocated char*. idx is an index to the next character in the string str. |
|
Initialization for the server. |
|
Prints message msg to local console. |
|
Takes the appropriate action to notify client at connection con of error errorcode. For errorcodes see file w3server.c (for now). |
|
Sends file pointed to by path to connection con. If the file is in the HTDOC_BIN_BASE directory, it is executed and the standard output stored in a temporary file and sent to the client. The temporary files are stored in HTDOC_BIN_TEMPLATE and should be removed from time to time, e.g. by a cron job (not done automatically). |
|
After a connection has been established, serve the client. This function does not disconnect. |
|
Starts a server on port port. |