WEBBY - the embedded web server with many faces / objects in plain C Snapshot
Classes | Modules | Typedefs | Enumerations | Functions
HTTP_SERVLET

a servlet is a class that processes the http request and produces the http response More...

Collaboration diagram for HTTP_SERVLET:

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)

Detailed Description

a servlet is a class that processes the http request and produces the http response


Typedef Documentation

typedef struct tagHTTP_SERVLET HTTP_SERVLET

HTTP_SERVLET definition.

called to handle an HTTP request

Definition at line 403 of file webby.h.

typedef void*(* HTTP_SERVLET_FREE)(struct tagHTTP_SERVLET *servlet_ctx)

free the servlet instance (optional)

Definition at line 396 of file webby.h.

typedef void( * HTTP_SERVLET_FREE_CONNECTION)(SERVLET_CONTEXT *contextx)

called when socket connection is closed.

Definition at line 408 of file webby.h.

typedef int(* HTTP_SERVLET_INIT)(struct tagHTTP_SERVLET *servlet_ctx)

initialise the servlet instance (optional)

Definition at line 391 of file webby.h.


Enumeration Type Documentation

Enumerator:
SERVLET_REQUEST_ERROR 

error occured while servlet instance has handled a request

SERVLET_REQUEST_HANDLED 

the request has been handled by this servlet

SERVLET_REQUEST_IGNORED 

the request has not been handled by this servlet

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;

Function Documentation

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;
}