void
HTTPD_LINKAGE write(
unsigned char *handle, unsigned char *data,
unsigned long *length, long *return_code);
This function processes the data and calls the server’s write function with
the new or changed data. The application must not attempt to free the
buffer passed to it nor expect the server to free the buffer it receives.
void
HTTPD_LINKAGE close(
unsigned char *handle, long *return_code);
This function performs any cleanup (such as flushing and freeing the
buffer) required to complete processing the data for this stream.
Log
void
HTTPD_LINKAGE Log(
unsigned char *handle, long *return_code);
This function is called after each request is processed and the
communication to the client is closed, regardless of the success or failure of
the request processing. Only HTTPD_extract() and HTTPD_set() are valid
during this step.
Error
void
HTTPD_LINKAGE Error(
unsigned char *handle, long *return_code);
This function is called only when an error is encountered and provides an
opportunity to customize the response.
PostExit
void
HTTPD_LINKAGE PostExit(
unsigned char *handle, long *return_code);
This function is called, regardless of the success or failure of the request, so
that you can clean up any resources that are allocated by your application
to process the request.
Server Termination
void
HTTPD_LINKAGE ServerTerm(
unsigned char *handle, long *return_code);
This function is processed when an orderly shutdown or restart of the
server occurs. It allows you to clean up resources that are allocated during
the Server Initialization step. Do not call any HTTP_* functions in this step
(the results are unpredictable). If you have more than one Server API
directive in your configuration file for Server Termination, they will all be
called.
HTTP return codes and values
These return codes follow the HTTP specification that is published by the World
Wide Web Consortium at URL: http://www.w3.org/pub/WWW/Protocols/. Your
application functions should return one of these values.
Chapter 7. Writing Server API programs 113