libasyncd
|
HTTP protocol request/response handler. More...
Go to the source code of this file.
Functions | |
int | ad_http_handler (short event, ad_conn_t *conn, void *userdata) |
HTTP protocol handler hook. | |
enum ad_http_request_status_e | ad_http_get_status (ad_conn_t *conn) |
Return the request status. | |
struct evbuffer * | ad_http_get_inbuf (ad_conn_t *conn) |
struct evbuffer * | ad_http_get_outbuf (ad_conn_t *conn) |
const char * | ad_http_get_request_header (ad_conn_t *conn, const char *name) |
off_t | ad_http_get_content_length (ad_conn_t *conn) |
void * | ad_http_get_content (ad_conn_t *conn, size_t maxsize, size_t *storedsize) |
int | ad_http_add_response_header (ad_conn_t *conn, const char *name, const char *value) |
int | ad_http_set_response_code (ad_conn_t *conn, int code, const char *reason) |
int | ad_http_set_response_content (ad_conn_t *conn, const char *contenttype, off_t size) |
size_t | ad_http_response (ad_conn_t *conn, int code, const char *contenttype, const void *data, off_t size) |
size_t | ad_http_send_header (ad_conn_t *conn) |
size_t | ad_http_send_data (ad_conn_t *conn, const void *data, size_t size) |
size_t | ad_http_send_chunk (ad_conn_t *conn, const void *data, size_t size) |
const char * | ad_http_get_reason (int code) |
HTTP protocol request/response handler.
Definition in file ad_http_handler.c.
int ad_http_handler | ( | short | event, |
ad_conn_t * | conn, | ||
void * | userdata | ||
) |
HTTP protocol handler hook.
This hook provides an easy way to handle HTTP request/response.
Definition at line 53 of file ad_http_handler.c.
enum ad_http_request_status_e ad_http_get_status | ( | ad_conn_t * | conn | ) |
Return the request status.
Definition at line 83 of file ad_http_handler.c.
|
read |
Definition at line 89 of file ad_http_handler.c.
|
read |
Definition at line 94 of file ad_http_handler.c.
const char* ad_http_get_request_header | ( | ad_conn_t * | conn, |
const char * | name | ||
) |
Definition at line 99 of file ad_http_handler.c.
off_t ad_http_get_content_length | ( | ad_conn_t * | conn | ) |
Definition at line 104 of file ad_http_handler.c.
void* ad_http_get_content | ( | ad_conn_t * | conn, |
size_t | maxsize, | ||
size_t * | storedsize | ||
) |
maxsize | maximum length of data to pull up. 0 to pull up everything. |
Definition at line 112 of file ad_http_handler.c.
int ad_http_add_response_header | ( | ad_conn_t * | conn, |
const char * | name, | ||
const char * | value | ||
) |
value | value string to set. NULL to remove the header. |
Definition at line 132 of file ad_http_handler.c.
int ad_http_set_response_code | ( | ad_conn_t * | conn, |
int | code, | ||
const char * | reason | ||
) |
Definition at line 151 of file ad_http_handler.c.
int ad_http_set_response_content | ( | ad_conn_t * | conn, |
const char * | contenttype, | ||
off_t | size | ||
) |
size | content size. -1 for chunked transfer encoding. |
Definition at line 168 of file ad_http_handler.c.
size_t ad_http_response | ( | ad_conn_t * | conn, |
int | code, | ||
const char * | contenttype, | ||
const void * | data, | ||
off_t | size | ||
) |
Definition at line 192 of file ad_http_handler.c.
size_t ad_http_send_header | ( | ad_conn_t * | conn | ) |
Definition at line 206 of file ad_http_handler.c.
size_t ad_http_send_data | ( | ad_conn_t * | conn, |
const void * | data, | ||
size_t | size | ||
) |
Definition at line 237 of file ad_http_handler.c.
size_t ad_http_send_chunk | ( | ad_conn_t * | conn, |
const void * | data, | ||
size_t | size | ||
) |
Definition at line 263 of file ad_http_handler.c.
const char* ad_http_get_reason | ( | int | code | ) |
Definition at line 294 of file ad_http_handler.c.