|
static int | _evhtp_request_parser_start (htparser *p) |
|
static int | _evhtp_request_parser_path (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_args (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_header_key (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_header_val (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_hostname (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_headers (htparser *p) |
|
static int | _evhtp_request_parser_body (htparser *p, const char *data, size_t len) |
|
static int | _evhtp_request_parser_fini (htparser *p) |
|
static int | _evhtp_request_parser_chunk_new (htparser *p) |
|
static int | _evhtp_request_parser_chunk_fini (htparser *p) |
|
static int | _evhtp_request_parser_chunks_fini (htparser *p) |
|
static int | _evhtp_request_parser_headers_start (htparser *p) |
|
static void | _evhtp_connection_readcb (evbev_t *bev, void *arg) |
|
static evhtp_connection_t * | _evhtp_connection_new (evhtp_t *htp, evutil_socket_t sock, evhtp_type type) |
|
static evhtp_uri_t * | _evhtp_uri_new (void) |
| create an overlay URI structure More...
|
|
static void | _evhtp_uri_free (evhtp_uri_t *uri) |
| frees an overlay URI structure More...
|
|
static evhtp_path_t * | _evhtp_path_new (const char *data, size_t len) |
| parses the path and file from an input buffer More...
|
|
static void | _evhtp_path_free (evhtp_path_t *path) |
|
const char * | status_code_to_str (evhtp_res code) |
|
static unsigned int | _evhtp_quick_hash (const char *str) |
| a weak hash function More...
|
|
static int | _evhtp_is_http_10 (const char major, const char minor) |
| helper function to determine if http version is HTTP/1.0 More...
|
|
static int | _evhtp_is_http_11 (const char major, const char minor) |
| helper function to determine if http version is HTTP/1.1 More...
|
|
static evhtp_proto | _evhtp_protocol (const char major, const char minor) |
| returns the HTTP protocol version More...
|
|
static evhtp_res | _evhtp_path_hook (evhtp_request_t *request, evhtp_path_t *path) |
| runs the user-defined on_path hook for a request More...
|
|
static evhtp_res | _evhtp_header_hook (evhtp_request_t *request, evhtp_header_t *header) |
| runs the user-defined on_header hook for a request More...
|
|
static evhtp_res | _evhtp_headers_hook (evhtp_request_t *request, evhtp_headers_t *headers) |
| runs the user-defined on_Headers hook for a request after all headers have been parsed. More...
|
|
static evhtp_res | _evhtp_body_hook (evhtp_request_t *request, evbuf_t *buf) |
| runs the user-defined on_body hook for requests containing a body. the data is stored in the request->buffer_in so the user may either leave it, or drain upon being called. More...
|
|
static evhtp_res | _evhtp_request_fini_hook (evhtp_request_t *request) |
| runs the user-defined hook called just prior to a request been free()'d More...
|
|
static evhtp_res | _evhtp_chunk_new_hook (evhtp_request_t *request, uint64_t len) |
|
static evhtp_res | _evhtp_chunk_fini_hook (evhtp_request_t *request) |
|
static evhtp_res | _evhtp_chunks_fini_hook (evhtp_request_t *request) |
|
static evhtp_res | _evhtp_headers_start_hook (evhtp_request_t *request) |
|
static evhtp_res | _evhtp_connection_fini_hook (evhtp_connection_t *connection) |
| runs the user-definedhook called just prior to a connection being closed More...
|
|
static evhtp_res | _evhtp_hostname_hook (evhtp_request_t *r, const char *hostname) |
|
static evhtp_res | _evhtp_connection_write_hook (evhtp_connection_t *connection) |
|
static int | _evhtp_glob_match (const char *pattern, const char *string) |
| glob/wildcard type pattern matching. More...
|
|
static evhtp_callback_t * | _evhtp_callback_find (evhtp_callbacks_t *cbs, const char *path, unsigned int *start_offset, unsigned int *end_offset) |
|
static evhtp_request_t * | _evhtp_request_new (evhtp_connection_t *c) |
| Creates a new evhtp_request_t. More...
|
|
static void | _evhtp_request_free (evhtp_request_t *request) |
| frees all data in an evhtp_request_t along with calling finished hooks More...
|
|
static evhtp_t * | _evhtp_request_find_vhost (evhtp_t *evhtp, const char *name) |
|
static int | _evhtp_request_set_callbacks (evhtp_request_t *request) |
|
static int | _evhtp_should_parse_query_body (evhtp_request_t *req) |
| determines if the request body contains the query arguments. if the query is NULL and the contenet length of the body has never been drained, and the content-type is x-www-form-urlencoded, the function returns 1 More...
|
|
static int | _evhtp_create_headers (evhtp_header_t *header, void *arg) |
|
static evbuf_t * | _evhtp_create_reply (evhtp_request_t *request, evhtp_res code) |
|
static void | _evhtp_connection_resumecb (int fd, short events, void *arg) |
|
static void | _evhtp_connection_writecb (evbev_t *bev, void *arg) |
|
static void | _evhtp_connection_eventcb (evbev_t *bev, short events, void *arg) |
|
static int | _evhtp_run_pre_accept (evhtp_t *htp, evhtp_connection_t *conn) |
|
static int | _evhtp_connection_accept (evbase_t *evbase, evhtp_connection_t *connection) |
|
static void | _evhtp_default_request_cb (evhtp_request_t *request, void *arg) |
|
static int | _evhtp_run_post_accept (evhtp_t *htp, evhtp_connection_t *connection) |
|
static void | _evhtp_run_in_thread (evthr_t *thr, void *arg, void *shared) |
|
static void | _evhtp_accept_cb (evserv_t *serv, int fd, struct sockaddr *s, int sl, void *arg) |
|
static unsigned long | _evhtp_ssl_get_thread_id (void) |
|
static void | _evhtp_ssl_thread_lock (int mode, int type, const char *file, int line) |
|
static void | _evhtp_ssl_delete_scache_ent (evhtp_ssl_ctx_t *ctx, evhtp_ssl_sess_t *sess) |
|
static int | _evhtp_ssl_add_scache_ent (evhtp_ssl_t *ssl, evhtp_ssl_sess_t *sess) |
|
static evhtp_ssl_sess_t * | _evhtp_ssl_get_scache_ent (evhtp_ssl_t *ssl, unsigned char *sid, int sid_len, int *copy) |
|
static int | _evhtp_ssl_servername (evhtp_ssl_t *ssl, int *unused, void *arg) |
|
htp_method | evhtp_request_get_method (evhtp_request_t *r) |
| returns the htp_method enum version of the request method. More...
|
|
void | evhtp_connection_pause (evhtp_connection_t *c) |
| pauses a connection (disables reading) More...
|
|
void | evhtp_connection_resume (evhtp_connection_t *c) |
| resumes a connection (enables reading) and activates resume event. More...
|
|
void | evhtp_request_pause (evhtp_request_t *request) |
| Wrapper around evhtp_connection_pause. More...
|
|
void | evhtp_request_resume (evhtp_request_t *request) |
| Wrapper around evhtp_connection_resume. More...
|
|
evhtp_header_t * | evhtp_header_key_add (evhtp_headers_t *headers, const char *key, char kalloc) |
| creates a new evhtp_header_t, sets only the key, and adds to the evhtp_headers TAILQ More...
|
|
evhtp_header_t * | evhtp_header_val_add (evhtp_headers_t *headers, const char *val, char valloc) |
| finds the last header in the headers tailq and adds the value More...
|
|
evhtp_kvs_t * | evhtp_kvs_new (void) |
|
evhtp_kv_t * | evhtp_kv_new (const char *key, const char *val, char kalloc, char valloc) |
| Allocates a new key/value structure. More...
|
|
void | evhtp_kv_free (evhtp_kv_t *kv) |
|
void | evhtp_kv_rm_and_free (evhtp_kvs_t *kvs, evhtp_kv_t *kv) |
|
void | evhtp_kvs_free (evhtp_kvs_t *kvs) |
|
int | evhtp_kvs_for_each (evhtp_kvs_t *kvs, evhtp_kvs_iterator cb, void *arg) |
|
const char * | evhtp_kv_find (evhtp_kvs_t *kvs, const char *key) |
|
evhtp_kv_t * | evhtp_kvs_find_kv (evhtp_kvs_t *kvs, const char *key) |
|
void | evhtp_kvs_add_kv (evhtp_kvs_t *kvs, evhtp_kv_t *kv) |
| appends a key/val structure to a evhtp_kvs_t tailq More...
|
|
void | evhtp_kvs_add_kvs (evhtp_kvs_t *dst, evhtp_kvs_t *src) |
| appends all key/val structures from src tailq onto dst tailq More...
|
|
static int | evhtp_is_hex_query_char (unsigned char ch) |
|
int | evhtp_unescape_string (unsigned char **out, unsigned char *str, size_t str_len) |
| Unescapes strings like '%7B1,%202,%203%7D' would become '{1, 2, 3}'. More...
|
|
evhtp_query_t * | evhtp_parse_query (const char *query, size_t len) |
| Parses the query portion of the uri into a set of key/values. More...
|
|
void | evhtp_send_reply_start (evhtp_request_t *request, evhtp_res code) |
|
void | evhtp_send_reply_body (evhtp_request_t *request, evbuf_t *buf) |
|
void | evhtp_send_reply_end (evhtp_request_t *request) |
|
void | evhtp_send_reply (evhtp_request_t *request, evhtp_res code) |
|
int | evhtp_response_needs_body (const evhtp_res code, const htp_method method) |
| Determine if a response should have a body. Follows the rules in RFC 2616 section 4.3. More...
|
|
void | evhtp_send_reply_chunk_start (evhtp_request_t *request, evhtp_res code) |
| start a chunked response. If data already exists on the output buffer, this will be converted to the first chunk. More...
|
|
void | evhtp_send_reply_chunk (evhtp_request_t *request, evbuf_t *buf) |
| send a chunk reply. More...
|
|
void | evhtp_send_reply_chunk_end (evhtp_request_t *request) |
| call when all chunks have been sent and you wish to send the last bits. This will add the last 0CRLFCRCL and call send_reply_end(). More...
|
|
void | evhtp_unbind_socket (evhtp_t *htp) |
| stops the listening socket. More...
|
|
int | evhtp_bind_sockaddr (evhtp_t *htp, struct sockaddr *sa, size_t sin_len, int backlog) |
| bind to an already allocated sockaddr. More...
|
|
int | evhtp_bind_socket (evhtp_t *htp, const char *baddr, uint16_t port, int backlog) |
| bind to a socket, optionally with specific protocol support formatting. The addr can be defined as one of the following: ipv6:<ipv6addr> for binding to an IPv6 address. unix:<named pipe>=""> for binding to a unix named socket ipv4:<ipv4addr> for binding to an ipv4 address Otherwise the addr is assumed to be ipv4. More...
|
|
void | evhtp_callbacks_free (evhtp_callbacks_t *callbacks) |
|
evhtp_callback_t * | evhtp_callback_new (const char *path, evhtp_callback_type type, evhtp_callback_cb cb, void *arg) |
| creates a new evhtp_callback_t structure. More...
|
|
void | evhtp_callback_free (evhtp_callback_t *callback) |
|
int | evhtp_callbacks_add_callback (evhtp_callbacks_t *cbs, evhtp_callback_t *cb) |
| Adds a evhtp_callback_t to the evhtp_callbacks_t list. More...
|
|
int | evhtp_set_hook (evhtp_hooks_t **hooks, evhtp_hook_type type, evhtp_hook cb, void *arg) |
| sets a callback hook for either a connection or a path/regex . More...
|
|
int | evhtp_unset_hook (evhtp_hooks_t **hooks, evhtp_hook_type type) |
| remove a specific hook from being called. More...
|
|
int | evhtp_unset_all_hooks (evhtp_hooks_t **hooks) |
| removes all hooks. More...
|
|
evhtp_callback_t * | evhtp_set_cb (evhtp_t *htp, const char *path, evhtp_callback_cb cb, void *arg) |
| sets a callback to be executed on a specific path More...
|
|
static void | _evhtp_thread_init (evthr_t *thr, void *arg) |
|
int | evhtp_use_threads (evhtp_t *htp, evhtp_thread_init_cb init_cb, int nthreads, void *arg) |
|
int | evhtp_use_callback_locks (evhtp_t *htp) |
| creates a lock around callbacks and hooks, allowing for threaded applications to add/remove/modify hooks & callbacks in a thread-safe manner. More...
|
|
evhtp_callback_t * | evhtp_set_regex_cb (evhtp_t *htp, const char *pattern, evhtp_callback_cb cb, void *arg) |
| sets a callback to be executed based on a regex pattern More...
|
|
evhtp_callback_t * | evhtp_set_glob_cb (evhtp_t *htp, const char *pattern, evhtp_callback_cb cb, void *arg) |
| sets a callback to to be executed on simple glob/wildcard patterns this is useful if the app does not care about what was matched, but just that it matched. This is technically faster than regex. More...
|
|
void | evhtp_set_gencb (evhtp_t *htp, evhtp_callback_cb cb, void *arg) |
| sets a callback which is called if no other callbacks are matched More...
|
|
void | evhtp_set_pre_accept_cb (evhtp_t *htp, evhtp_pre_accept_cb cb, void *arg) |
|
void | evhtp_set_post_accept_cb (evhtp_t *htp, evhtp_post_accept_cb cb, void *arg) |
|
int | evhtp_ssl_use_threads (void) |
|
int | evhtp_ssl_init (evhtp_t *htp, evhtp_ssl_cfg_t *cfg) |
|
evbev_t * | evhtp_connection_get_bev (evhtp_connection_t *connection) |
| returns the underlying connections bufferevent More...
|
|
evbev_t * | evhtp_connection_take_ownership (evhtp_connection_t *connection) |
| let a user take ownership of the underlying bufferevent and free all other underlying resources. More...
|
|
evbev_t * | evhtp_request_get_bev (evhtp_request_t *request) |
| returns the underlying requests bufferevent More...
|
|
evbev_t * | evhtp_request_take_ownership (evhtp_request_t *request) |
|
void | evhtp_connection_set_bev (evhtp_connection_t *conn, evbev_t *bev) |
| Sets the connections underlying bufferevent. More...
|
|
void | evhtp_request_set_bev (evhtp_request_t *request, evbev_t *bev) |
| sets the underlying bufferevent for a evhtp_request More...
|
|
evhtp_connection_t * | evhtp_request_get_connection (evhtp_request_t *request) |
| returns the underlying evhtp_connection_t structure from a request More...
|
|
void | evhtp_connection_set_timeouts (evhtp_connection_t *c, const struct timeval *rtimeo, const struct timeval *wtimeo) |
| sets a connection-specific read/write timeout which overrides the global read/write settings. More...
|
|
void | evhtp_connection_set_max_body_size (evhtp_connection_t *c, uint64_t len) |
| set a max body size for a specific connection, this will default to the size set by evhtp_set_max_body_size More...
|
|
void | evhtp_request_set_max_body_size (evhtp_request_t *req, uint64_t len) |
| just calls evhtp_connection_set_max_body_size for the request. More...
|
|
void | evhtp_connection_free (evhtp_connection_t *connection) |
| free's all connection related resources, this will also call your request fini hook and request fini hook. More...
|
|
void | evhtp_request_free (evhtp_request_t *request) |
|
void | evhtp_set_timeouts (evhtp_t *htp, const struct timeval *r_timeo, const struct timeval *w_timeo) |
| set a read/write timeout on all things evhtp_t. When the timeout expires your error hook will be called with the libevent supplied event flags. More...
|
|
void | evhtp_set_max_keepalive_requests (evhtp_t *htp, uint64_t num) |
| sets a maximum number of requests that a single connection can make. More...
|
|
void | evhtp_set_bev_flags (evhtp_t *htp, int flags) |
| set bufferevent flags, defaults to BEV_OPT_CLOSE_ON_FREE More...
|
|
void | evhtp_set_max_body_size (evhtp_t *htp, uint64_t len) |
| set a max body size to accept for an incoming request, this will default to unlimited. More...
|
|
void | evhtp_disable_100_continue (evhtp_t *htp) |
| when a client sends an Expect: 100-continue, if this is function is called, evhtp will not send a HTTP/x.x continue response. More...
|
|
int | evhtp_add_alias (evhtp_t *evhtp, const char *name) |
| Add an alias hostname for a virtual-host specific evhtp_t. This avoids having multiple evhtp_t virtual hosts with the same callback for the same vhost. More...
|
|
int | evhtp_add_vhost (evhtp_t *evhtp, const char *name, evhtp_t *vhost) |
| add a virtual host. More...
|
|
evhtp_t * | evhtp_new (evbase_t *evbase, void *arg) |
| creates a new evhtp_t instance More...
|
|
void | evhtp_free (evhtp_t *evhtp) |
|
int | evhtp_connection_set_rate_limit (evhtp_connection_t *conn, size_t read_rate, size_t read_burst, size_t write_rate, size_t write_burst, const struct timeval *tick) |
|
evhtp_connection_t * | evhtp_connection_new (evbase_t *evbase, const char *addr, uint16_t port) |
| allocate a new connection More...
|
|
evhtp_request_t * | evhtp_request_new (evhtp_callback_cb cb, void *arg) |
| allocate a new request More...
|
|
int | evhtp_make_request (evhtp_connection_t *c, evhtp_request_t *r, htp_method meth, const char *uri) |
| make a client request More...
|
|
unsigned int | evhtp_request_status (evhtp_request_t *r) |
|