Go to the source code of this file.
Data Structures | |
struct | entry |
struct | inetaddress |
struct | request |
struct | requestwrapper |
struct | response |
struct | ServiceImpl |
Defines | |
#define | SERVER_NAME "monit" |
#define | SERVER_VERSION VERSION |
#define | SERVER_URL "http://www.tildeslash.com/monit/" |
#define | SERVER_PROTOCOL "HTTP/1.0" |
#define | DATEFMT "%a, %d %b %Y %H:%M:%S GMT" |
#define | METHOD_GET "GET" |
#define | METHOD_POST "POST" |
#define | SC_CONTINUE 100 |
#define | SC_SWITCHING_PROTOCOLS 101 |
#define | SC_PROCESSING 102 |
#define | SC_OK 200 |
#define | SC_CREATED 201 |
#define | SC_ACCEPTED 202 |
#define | SC_NON_AUTHORITATIVE 203 |
#define | SC_NO_CONTENT 204 |
#define | SC_RESET_CONTENT 205 |
#define | SC_PARTIAL_CONTENT 206 |
#define | SC_MULTI_STATUS 207 |
#define | SC_MULTIPLE_CHOICES 300 |
#define | SC_MOVED_PERMANENTLY 301 |
#define | SC_MOVED_TEMPORARILY 302 |
#define | SC_SEE_OTHER 303 |
#define | SC_NOT_MODIFIED 304 |
#define | SC_USE_PROXY 305 |
#define | SC_TEMPORARY_REDIRECT 307 |
#define | SC_BAD_REQUEST 400 |
#define | SC_UNAUTHORIZED 401 |
#define | SC_PAYMENT_REQUIRED 402 |
#define | SC_FORBIDDEN 403 |
#define | SC_NOT_FOUND 404 |
#define | SC_METHOD_NOT_ALLOWED 405 |
#define | SC_NOT_ACCEPTABLE 406 |
#define | SC_PROXY_AUTHENTICATION_REQUIRED 407 |
#define | SC_REQUEST_TIMEOUT 408 |
#define | SC_CONFLICT 409 |
#define | SC_GONE 410 |
#define | SC_LENGTH_REQUIRED 411 |
#define | SC_PRECONDITION_FAILED 412 |
#define | SC_REQUEST_ENTITY_TOO_LARGE 413 |
#define | SC_REQUEST_URI_TOO_LARGE 414 |
#define | SC_UNSUPPORTED_MEDIA_TYPE 415 |
#define | SC_RANGE_NOT_SATISFIABLE 416 |
#define | SC_EXPECTATION_FAILED 417 |
#define | SC_UNPROCESSABLE_ENTITY 422 |
#define | SC_LOCKED 423 |
#define | SC_FAILED_DEPENDENCY 424 |
#define | SC_INTERNAL_SERVER_ERROR 500 |
#define | SC_NOT_IMPLEMENTED 501 |
#define | SC_BAD_GATEWAY 502 |
#define | SC_SERVICE_UNAVAILABLE 503 |
#define | SC_GATEWAY_TIMEOUT 504 |
#define | SC_VERSION_NOT_SUPPORTED 505 |
#define | SC_VARIANT_ALSO_VARIES 506 |
#define | SC_INSUFFICIENT_STORAGE 507 |
#define | SC_NOT_EXTENDED 510 |
#define | STRLEN 256 |
#define | REQ_STRLEN 1024 |
#define | RES_STRLEN 2048 |
#define | REQUEST_TIMEOUT 30 |
#define | TRUE 1 |
#define | FALSE 0 |
Typedefs | |
typedef entry * | HttpHeader |
typedef entry * | HttpParameter |
typedef inetaddress * | InetAddress |
typedef requestwrapper * | RequestWrapper |
typedef request * | HttpRequest |
typedef response * | HttpResponse |
Functions | |
void * | http_processor (void *) |
Process a HTTP request. | |
void | add_Impl (void *doGetFunc, void *doPostFunc) |
Callback for implementors of cervlet functions. | |
void | send_error (HttpResponse, int status, char *message) |
Send an error message. | |
void | send_redirect (HttpResponse res, char *location) |
Sends a temporary redirect response to the client using the specified redirect Location URL. | |
void | out_print (HttpResponse res, const char *,...) |
Prints a string into the given HttpResponse output buffer. | |
void | set_header (HttpResponse res, char *name, char *value) |
Adds a response header with the given name and value. | |
void | set_status (HttpResponse res, int status, char *status_message) |
Sets the status code for the response. | |
void | set_content_type (HttpResponse res, char *mime) |
Set the response content-type. | |
char * | get_header (HttpRequest req, const char *header_name) |
Returns the value of the specified header. | |
char * | get_headers (HttpResponse res) |
Returns a string containing all (extra) headers found in the response. | |
char * | get_parameter (HttpRequest req, const char *parameter_name) |
Returns the value of the specified parameter. | |
char * | get_status_string (int status_code) |
Lookup the corresponding HTTP status string for the given status code. | |
void | destroy_wrapper (RequestWrapper wrapper) |
Free a RequestWrapper object. | |
Variables | |
ServiceImpl | Impl |
|
Definition at line 36 of file processor.h. |
|
Definition at line 101 of file processor.h. |
|
Definition at line 39 of file processor.h. |
|
Definition at line 40 of file processor.h. |
|
Definition at line 94 of file processor.h. |
|
Definition at line 98 of file processor.h. |
|
Definition at line 95 of file processor.h. Referenced by get_headers(), and out_print(). |
|
Definition at line 48 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 84 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 61 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 70 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 43 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 47 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 78 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 81 of file processor.h. |
|
Definition at line 64 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 86 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 71 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 89 of file processor.h. |
|
Definition at line 82 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 72 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 80 of file processor.h. |
|
Definition at line 66 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 55 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 56 of file processor.h. Referenced by get_status_string(), and send_redirect(). |
|
Definition at line 53 of file processor.h. |
|
Definition at line 54 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 50 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 49 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 67 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 90 of file processor.h. |
|
Definition at line 65 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 83 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 58 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 46 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 52 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 63 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 73 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 45 of file processor.h. |
|
Definition at line 68 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 77 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 74 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 69 of file processor.h. Referenced by get_status_string(), and http_processor(). |
|
Definition at line 75 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 51 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 57 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 85 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 44 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 60 of file processor.h. |
|
Definition at line 62 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 79 of file processor.h. |
|
Definition at line 76 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 59 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 88 of file processor.h. |
|
Definition at line 87 of file processor.h. Referenced by get_status_string(). |
|
Definition at line 32 of file processor.h. |
|
Definition at line 35 of file processor.h. |
|
Definition at line 34 of file processor.h. Referenced by send_error(). |
|
Definition at line 33 of file processor.h. |
|
Definition at line 93 of file processor.h. |
|
Definition at line 100 of file processor.h. |
|
Definition at line 109 of file processor.h. |
|
Definition at line 110 of file processor.h. |
|
|
|
|
|
|
|
|
|
Callback for implementors of cervlet functions.
Definition at line 149 of file processor.c. References ServiceImpl::doGet, ServiceImpl::doPost, and Impl. Referenced by init_service(). |
|
Free a RequestWrapper object.
Definition at line 303 of file processor.c. References close_accepted_ssl_socket(), close_socket(), myrun::httpdssl, requestwrapper::inetaddr, inetaddress::local_host, mySSLServerConnection, inetaddress::remote_host, Run, requestwrapper::socket, and requestwrapper::ssl. Referenced by http_processor(), and start_httpd(). |
|
Returns the value of the specified header.
Definition at line 406 of file processor.c. References request::headers, entry::name, entry::next, entry::value, and xstrdup(). |
|
Returns a string containing all (extra) headers found in the response. The headers are newline separated in the returned string.
Definition at line 457 of file processor.c. References response::headers, entry::name, entry::next, RES_STRLEN, entry::value, and xstrdup(). |
|
Returns the value of the specified parameter.
Definition at line 431 of file processor.c. References entry::name, entry::next, request::params, entry::value, and xstrdup(). |
|
|
Process a HTTP request. This is done by dispatching to the service function. Before the dispatch, an alarm clock is setup for handling request timeout.
Definition at line 123 of file processor.c. References destroy_wrapper(), SC_REQUEST_TIMEOUT, and requestwrapper::socket. Referenced by start_httpd(). |
|
Prints a string into the given HttpResponse output buffer. The actual response to the client is done in the service function, which will call the private function send_response. Cervlets should use this function (i.e. out_print) for sending a response, and never use the HttpResponse outputstream directly. Despite the above warning, IF the HttpResponse.outputstream was used directly by a cervlet THEN the cervlet MUST set the is_committed flag in the HttpResponse object and is responsible for sending all HTTP headers and content by itself.
Definition at line 217 of file processor.c. References response::bufsize, response::bufused, log(), response::outputbuffer, RES_STRLEN, xmalloc(), and xresize(). Referenced by send_error(). |
|
Send an error message.
Definition at line 166 of file processor.c. References get_status_string(), out_print(), SERVER_URL, set_content_type(), and set_status(). |
|
Sends a temporary redirect response to the client using the specified redirect Location URL. The url must be absolute.
Definition at line 192 of file processor.c. References get_status_string(), SC_MOVED_TEMPORARILY, set_header(), and set_status(). |
|
Set the response content-type.
Definition at line 393 of file processor.c. References set_header(). Referenced by send_error(). |
|
Adds a response header with the given name and value. If the header had already been set the new value overwrites the previous one.
Definition at line 338 of file processor.c. References response::headers, entry::name, NEW, entry::next, entry::value, and xstrdup(). Referenced by send_redirect(), and set_content_type(). |
|
Sets the status code for the response.
Definition at line 379 of file processor.c. References response::status, response::status_msg, and xstrdup(). Referenced by send_error(), and send_redirect(). |
|
Definition at line 161 of file processor.h. Referenced by add_Impl(). |