HomePort
|
Go to the source code of this file.
Functions | |
hpd_error_t | http_request_create (hpd_httpd_request_t **req, hpd_httpd_t *httpd, hpd_httpd_settings_t *settings, hpd_tcpd_conn_t *conn, const hpd_module_t *context) |
Create a new ws_request. More... | |
hpd_error_t | http_request_destroy (hpd_httpd_request_t *req) |
Destroy a ws_request. More... | |
hpd_error_t | http_request_get_connection (hpd_httpd_request_t *req, hpd_tcpd_conn_t **conn) |
Get the connection of a request. More... | |
hpd_error_t | http_request_get_context (hpd_httpd_request_t *req, const hpd_module_t **context) |
hpd_error_t | http_request_parse (hpd_httpd_request_t *req, const char *buf, size_t len) |
Parse a new chunk of the message. More... | |
hpd_error_t http_request_create | ( | hpd_httpd_request_t ** | req, |
hpd_httpd_t * | httpd, | ||
hpd_httpd_settings_t * | settings, | ||
hpd_tcpd_conn_t * | conn, | ||
const hpd_module_t * | context | ||
) |
Create a new ws_request.
The created ws_request is ready to receive data through ws_reqeust_parse(), and it should be freed using ws_request_destroy() to avoid memory leaks.
webserver | The httpd creating the request |
settings | The settings for the webserver receiving the request. This will determine which callbacks to call on events. |
conn | The connection on which the request is being received |
Definition at line 601 of file httpd_request.c.
hpd_error_t http_request_destroy | ( | hpd_httpd_request_t * | req | ) |
Destroy a ws_request.
All ws_requests should be freed by a call to this function to avoid memory leaks.
req | The request to be destroyed. |
Definition at line 660 of file httpd_request.c.
hpd_error_t http_request_get_connection | ( | hpd_httpd_request_t * | req, |
hpd_tcpd_conn_t ** | conn | ||
) |
Get the connection of a request.
req | http request |
Definition at line 889 of file httpd_request.c.
hpd_error_t http_request_get_context | ( | hpd_httpd_request_t * | req, |
const hpd_module_t ** | context | ||
) |
hpd_error_t http_request_parse | ( | hpd_httpd_request_t * | req, |
const char * | buf, | ||
size_t | len | ||
) |
Parse a new chunk of the message.
This will sent the chunk to the http_parser, which will parse the new chunk and call the callbacks defined in parser_settings on events. The callbacks will change state of the ws_request and make calls on the functions defined in hpd_tcpd_settings.
req | The request, to which the chunk should be added. |
buf | The chunk, which is not assumed to be \0 terminated. |
len | Length of the chuck. |
Definition at line 697 of file httpd_request.c.