WEBBY - the embedded web server with many faces / objects in plain C Snapshot
|
a servlet is a class that processes the http request and produces the http response More...
Classes | |
struct | tagSERVLET_CONTEXT |
struct | tagHTTP_SERVLET |
HTTP_SERVLET definition. More... | |
Modules | |
HTTP_servlet_request | |
represents the http request and includes methods to access the request header and request body. | |
HTTP_servlet_response | |
represents the http response and includes methods to set response header and send the response body. | |
Typedefs | |
typedef struct tagSERVLET_CONTEXT | SERVLET_CONTEXT |
typedef int(* | HTTP_SERVLET_INIT )(struct tagHTTP_SERVLET *servlet_ctx) |
initialise the servlet instance (optional) | |
typedef void *(* | HTTP_SERVLET_FREE )(struct tagHTTP_SERVLET *servlet_ctx) |
free the servlet instance (optional) | |
typedef SERVLET_STATUS(* | HTTP_SERVLET_ACTION )(HTTP_servlet_request *request, HTTP_servlet_response *response, SERVLET_CONTEXT *context) |
called to handle an HTTP request | |
typedef void(* | HTTP_SERVLET_FREE_CONNECTION )(SERVLET_CONTEXT *contextx) |
called when socket connection is closed. | |
typedef struct tagHTTP_SERVLET | HTTP_SERVLET |
HTTP_SERVLET definition. | |
Enumerations | |
enum | SERVLET_STATUS { SERVLET_REQUEST_ERROR = -1, SERVLET_REQUEST_HANDLED = 0, SERVLET_REQUEST_IGNORED = 1 } |
Functions | |
M_INLINE void | HTTP_SERVLET_init (HTTP_SERVLET *servlet, HTTP_SERVLET_INIT init_servlet, HTTP_SERVLET_FREE free_servlet, HTTP_SERVLET_ACTION servlet_action, HTTP_SERVLET_FREE_CONNECTION free_connection) |
a servlet is a class that processes the http request and produces the http response
typedef struct tagHTTP_SERVLET HTTP_SERVLET |
HTTP_SERVLET definition.
typedef SERVLET_STATUS( * HTTP_SERVLET_ACTION)(HTTP_servlet_request *request, HTTP_servlet_response *response, SERVLET_CONTEXT *context) |
typedef void*(* HTTP_SERVLET_FREE)(struct tagHTTP_SERVLET *servlet_ctx) |
typedef void( * HTTP_SERVLET_FREE_CONNECTION)(SERVLET_CONTEXT *contextx) |
typedef int(* HTTP_SERVLET_INIT)(struct tagHTTP_SERVLET *servlet_ctx) |
typedef struct tagSERVLET_CONTEXT SERVLET_CONTEXT |
enum SERVLET_STATUS |
Definition at line 366 of file webby.h.
{ /** error occured while servlet instance has handled a request */ SERVLET_REQUEST_ERROR = -1, /** the request has been handled by this servlet */ SERVLET_REQUEST_HANDLED = 0, /** the request has not been handled by this servlet */ SERVLET_REQUEST_IGNORED = 1, } SERVLET_STATUS;
M_INLINE void HTTP_SERVLET_init | ( | HTTP_SERVLET * | servlet, |
HTTP_SERVLET_INIT | init_servlet, | ||
HTTP_SERVLET_FREE | free_servlet, | ||
HTTP_SERVLET_ACTION | servlet_action, | ||
HTTP_SERVLET_FREE_CONNECTION | free_connection | ||
) |
Definition at line 422 of file webby.h.
{ servlet->init_servlet = init_servlet; servlet->free_servlet = free_servlet; servlet->servlet_action = servlet_action; servlet->free_connection = free_connection; }