evhtp/evhtp.h
Go to the documentation of this file.
#include <evhtp/config.h>
#ifndef __EVHTP__H__
#define __EVHTP__H__
#ifndef EVHTP_DISABLE_EVTHR
#include <evhtp/thread.h>
#endif
#include <evhtp/parser.h>
#ifndef EVHTP_DISABLE_REGEX
#include <onigposix.h>
#endif
#include <sys/queue.h>
#include <event2/event.h>
#include <event2/listener.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
#ifndef EVHTP_DISABLE_SSL
#include <event2/bufferevent_ssl.h>
#include <openssl/dh.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct evhtp_callback;
struct evhtp_callbacks;
struct evhtp_kvs;
#ifndef EVHTP_DISABLE_SSL
typedef SSL_SESSION evhtp_ssl_sess_t;
typedef SSL evhtp_ssl_t;
typedef SSL_CTX evhtp_ssl_ctx_t;
typedef X509 evhtp_x509_t;
typedef X509_STORE_CTX evhtp_x509_store_ctx_t;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
typedef unsigned char evhtp_ssl_data_t;
#else
typedef const unsigned char evhtp_ssl_data_t;
#endif
#else
typedef void evhtp_ssl_sess_t;
typedef void evhtp_ssl_t;
typedef void evhtp_ssl_ctx_t;
typedef void evhtp_x509_t;
typedef void evhtp_x509_store_ctx_t;
#endif
typedef struct evbuffer evbuf_t;
typedef struct event event_t;
typedef struct evconnlistener evserv_t;
typedef struct bufferevent evbev_t;
#ifdef EVHTP_DISABLE_EVTHR
typedef struct event_base evbase_t;
typedef void evthr_t;
typedef void evthr_pool_t;
typedef void evhtp_mutex_t;
#else
typedef pthread_mutex_t evhtp_mutex_t;
#endif
typedef struct evhtp evhtp_t;
typedef struct evhtp_defaults evhtp_defaults_t;
typedef struct evhtp_callbacks evhtp_callbacks_t;
typedef struct evhtp_callback evhtp_callback_t;
typedef struct evhtp_kv evhtp_kv_t;
typedef struct evhtp_kvs evhtp_kvs_t;
typedef struct evhtp_uri evhtp_uri_t;
typedef struct evhtp_path evhtp_path_t;
typedef struct evhtp_authority evhtp_authority_t;
typedef struct evhtp_request evhtp_request_t;
typedef struct evhtp_hooks evhtp_hooks_t;
typedef struct evhtp_connection evhtp_connection_t;
typedef struct evhtp_ssl_cfg evhtp_ssl_cfg_t;
typedef struct evhtp_alias evhtp_alias_t;
typedef uint16_t evhtp_res;
typedef uint8_t evhtp_error_flags;
typedef struct evhtp_kv evhtp_header_t;
typedef struct evhtp_kvs evhtp_headers_t;
typedef struct evhtp_kvs evhtp_query_t;
enum evhtp_ssl_scache_type {
evhtp_ssl_scache_type_disabled = 0,
evhtp_ssl_scache_type_internal,
evhtp_ssl_scache_type_user,
evhtp_ssl_scache_type_builtin
};
enum evhtp_hook_type {
evhtp_hook_on_header,
evhtp_hook_on_headers,
evhtp_hook_on_path,
evhtp_hook_on_read,
evhtp_hook_on_request_fini,
evhtp_hook_on_connection_fini,
evhtp_hook_on_new_chunk,
evhtp_hook_on_chunk_complete,
evhtp_hook_on_chunks_complete,
evhtp_hook_on_headers_start,
evhtp_hook_on_error,
evhtp_hook_on_hostname,
evhtp_hook_on_write,
evhtp_hook_on_event,
evhtp_hook_on_conn_error,
evhtp_hook__max
};
enum evhtp_callback_type {
evhtp_callback_type_hash,
evhtp_callback_type_glob,
#ifndef EVHTP_DISABLE_REGEX
evhtp_callback_type_regex,
#endif
};
enum evhtp_proto {
EVHTP_PROTO_INVALID,
EVHTP_PROTO_10,
EVHTP_PROTO_11
};
enum evhtp_type {
evhtp_type_client,
evhtp_type_server
};
typedef enum evhtp_hook_type evhtp_hook_type;
typedef enum evhtp_callback_type evhtp_callback_type;
typedef enum evhtp_proto evhtp_proto;
typedef enum evhtp_ssl_scache_type evhtp_ssl_scache_type;
typedef enum evhtp_type evhtp_type;
typedef void (* evhtp_thread_init_cb)(evhtp_t * htp, evthr_t * thr, void * arg);
typedef void (* evhtp_thread_exit_cb)(evhtp_t * htp, evthr_t * thr, void * arg);
typedef void (* evhtp_callback_cb)(evhtp_request_t * req, void * arg);
typedef void (* evhtp_hook_err_cb)(evhtp_request_t * req, evhtp_error_flags errtype, void * arg);
typedef void (* evhtp_hook_event_cb)(evhtp_connection_t * conn, short events, void * arg);
/* Generic hook for passing ISO tests */
typedef evhtp_res (* evhtp_hook)();
typedef evhtp_res (* evhtp_hook_conn_err_cb)(evhtp_connection_t * connection, evhtp_error_flags errtype, void * arg);
typedef evhtp_res (* evhtp_pre_accept_cb)(evhtp_connection_t * conn, void * arg);
typedef evhtp_res (* evhtp_post_accept_cb)(evhtp_connection_t * conn, void * arg);
typedef evhtp_res (* evhtp_hook_header_cb)(evhtp_request_t * req, evhtp_header_t * hdr, void * arg);
typedef evhtp_res (* evhtp_hook_headers_cb)(evhtp_request_t * req, evhtp_headers_t * hdr, void * arg);
typedef evhtp_res (* evhtp_hook_path_cb)(evhtp_request_t * req, evhtp_path_t * path, void * arg);
typedef evhtp_res (* evhtp_hook_read_cb)(evhtp_request_t * req, struct evbuffer * buf, void * arg);
typedef evhtp_res (* evhtp_hook_request_fini_cb)(evhtp_request_t * req, void * arg);
typedef evhtp_res (* evhtp_hook_connection_fini_cb)(evhtp_connection_t * connection, void * arg);
typedef evhtp_res (* evhtp_hook_chunk_new_cb)(evhtp_request_t * r, uint64_t len, void * arg);
typedef evhtp_res (* evhtp_hook_chunk_fini_cb)(evhtp_request_t * r, void * arg);
typedef evhtp_res (* evhtp_hook_chunks_fini_cb)(evhtp_request_t * r, void * arg);
typedef evhtp_res (* evhtp_hook_headers_start_cb)(evhtp_request_t * r, void * arg);
typedef evhtp_res (* evhtp_hook_hostname_cb)(evhtp_request_t * r, const char * hostname, void * arg);
typedef evhtp_res (* evhtp_hook_write_cb)(evhtp_connection_t * conn, void * arg);
typedef int (* evhtp_kvs_iterator)(evhtp_kv_t * kv, void * arg);
typedef int (* evhtp_headers_iterator)(evhtp_header_t * header, void * arg);
#ifndef EVHTP_DISABLE_SSL
typedef int (* evhtp_ssl_verify_cb)(int pre_verify, evhtp_x509_store_ctx_t * ctx);
typedef int (* evhtp_ssl_chk_issued_cb)(evhtp_x509_store_ctx_t * ctx, evhtp_x509_t * x, evhtp_x509_t * issuer);
typedef EVP_PKEY * (* evhtp_ssl_decrypt_cb)(char * privfile);
typedef int (* evhtp_ssl_scache_add)(evhtp_connection_t * connection, evhtp_ssl_data_t * sid, int sid_len, evhtp_ssl_sess_t * sess);
typedef void (* evhtp_ssl_scache_del)(evhtp_t * htp, evhtp_ssl_data_t * sid, int sid_len);
typedef evhtp_ssl_sess_t * (* evhtp_ssl_scache_get)(evhtp_connection_t * connection, evhtp_ssl_data_t * sid, int sid_len);
typedef void * (* evhtp_ssl_scache_init)(evhtp_t *);
#endif
#define EVHTP_VERSION "1.2.18"
#define EVHTP_VERSION_MAJOR 1
#define EVHTP_VERSION_MINOR 2
#define EVHTP_VERSION_PATCH 18
#define evhtp_headers_iterator evhtp_kvs_iterator
#define EVHTP_RES_ERROR 0
#define EVHTP_RES_PAUSE 1
#define EVHTP_RES_FATAL 2
#define EVHTP_RES_USER 3
#define EVHTP_RES_DATA_TOO_LONG 4
#define EVHTP_RES_OK 200
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define EVHTP_RES_100 100
#define EVHTP_RES_CONTINUE 100
#define EVHTP_RES_SWITCH_PROTO 101
#define EVHTP_RES_PROCESSING 102
#define EVHTP_RES_URI_TOOLONG 122
#define EVHTP_RES_200 200
#define EVHTP_RES_CREATED 201
#define EVHTP_RES_ACCEPTED 202
#define EVHTP_RES_NAUTHINFO 203
#define EVHTP_RES_NOCONTENT 204
#define EVHTP_RES_RSTCONTENT 205
#define EVHTP_RES_PARTIAL 206
#define EVHTP_RES_MSTATUS 207
#define EVHTP_RES_IMUSED 226
#define EVHTP_RES_300 300
#define EVHTP_RES_MCHOICE 300
#define EVHTP_RES_MOVEDPERM 301
#define EVHTP_RES_FOUND 302
#define EVHTP_RES_SEEOTHER 303
#define EVHTP_RES_NOTMOD 304
#define EVHTP_RES_USEPROXY 305
#define EVHTP_RES_SWITCHPROXY 306
#define EVHTP_RES_TMPREDIR 307
#define EVHTP_RES_400 400
#define EVHTP_RES_BADREQ 400
#define EVHTP_RES_UNAUTH 401
#define EVHTP_RES_PAYREQ 402
#define EVHTP_RES_FORBIDDEN 403
#define EVHTP_RES_NOTFOUND 404
#define EVHTP_RES_METHNALLOWED 405
#define EVHTP_RES_NACCEPTABLE 406
#define EVHTP_RES_PROXYAUTHREQ 407
#define EVHTP_RES_TIMEOUT 408
#define EVHTP_RES_CONFLICT 409
#define EVHTP_RES_GONE 410
#define EVHTP_RES_LENREQ 411
#define EVHTP_RES_PRECONDFAIL 412
#define EVHTP_RES_ENTOOLARGE 413
#define EVHTP_RES_URITOOLARGE 414
#define EVHTP_RES_UNSUPPORTED 415
#define EVHTP_RES_RANGENOTSC 416
#define EVHTP_RES_EXPECTFAIL 417
#define EVHTP_RES_IAMATEAPOT 418
#define EVHTP_RES_500 500
#define EVHTP_RES_SERVERR 500
#define EVHTP_RES_NOTIMPL 501
#define EVHTP_RES_BADGATEWAY 502
#define EVHTP_RES_SERVUNAVAIL 503
#define EVHTP_RES_GWTIMEOUT 504
#define EVHTP_RES_VERNSUPPORT 505
#define EVHTP_RES_BWEXEED 509
#endif
struct evhtp_defaults {
evhtp_callback_cb cb;
evhtp_pre_accept_cb pre_accept;
evhtp_post_accept_cb post_accept;
void * cbarg;
void * pre_accept_cbarg;
void * post_accept_cbarg;
};
struct evhtp_alias {
char * alias;
TAILQ_ENTRY(evhtp_alias) next;
};
struct evhtp {
evhtp_t * parent;
struct event_base * evbase;
struct evconnlistener * server;
char * server_name;
void * arg;
int bev_flags;
uint64_t max_body_size;
uint64_t max_keepalive_requests;
#define EVHTP_FLAG_ENABLE_100_CONT (1 << 1)
#define EVHTP_FLAG_ENABLE_REUSEPORT (1 << 2)
#define EVHTP_FLAG_ENABLE_NODELAY (1 << 3)
#define EVHTP_FLAG_ENABLE_DEFER_ACCEPT (1 << 4)
#define EVHTP_FLAG_DEFAULTS EVHTP_FLAG_ENABLE_100_CONT
#define EVHTP_FLAG_ENABLE_ALL EVHTP_FLAG_ENABLE_100_CONT \
| EVHTP_FLAG_ENABLE_REUSEPORT \
| EVHTP_FLAG_ENABLE_NODELAY \
| EVHTP_FLAG_ENABLE_DEFER_ACCEPT
uint16_t flags;
uint16_t parser_flags;
#ifndef EVHTP_DISABLE_SSL
evhtp_ssl_ctx_t * ssl_ctx;
evhtp_ssl_cfg_t * ssl_cfg;
#endif
#ifndef EVHTP_DISABLE_EVTHR
evthr_pool_t * thr_pool;
pthread_mutex_t * lock;
evhtp_thread_init_cb thread_init_cb;
evhtp_thread_exit_cb thread_exit_cb;
/* keep backwards compat because I'm dumb and didn't
* make these structs private
*/
#define thread_init_cbarg thread_cbarg
void * thread_cbarg;
#endif
evhtp_callbacks_t * callbacks;
evhtp_defaults_t defaults;
struct timeval recv_timeo;
struct timeval send_timeo;
TAILQ_HEAD(, evhtp_alias) aliases;
TAILQ_HEAD(, evhtp) vhosts;
TAILQ_ENTRY(evhtp) next_vhost;
};
struct evhtp_kv {
char * key;
char * val;
size_t klen;
size_t vlen;
char k_heaped;
char v_heaped;
TAILQ_ENTRY(evhtp_kv) next;
};
TAILQ_HEAD(evhtp_kvs, evhtp_kv);
struct evhtp_uri {
evhtp_authority_t * authority;
evhtp_path_t * path;
unsigned char * fragment;
unsigned char * query_raw;
evhtp_query_t * query;
htp_scheme scheme;
};
struct evhtp_authority {
char * username;
char * password;
char * hostname;
uint16_t port;
};
struct evhtp_path {
char * full;
char * path;
char * file;
char * match_start;
char * match_end;
unsigned int matched_soff;
unsigned int matched_eoff;
};
struct evhtp_request {
evhtp_t * htp;
evhtp_connection_t * conn;
evhtp_hooks_t * hooks;
evhtp_uri_t * uri;
struct evbuffer * buffer_in;
struct evbuffer * buffer_out;
evhtp_headers_t * headers_in;
evhtp_headers_t * headers_out;
evhtp_proto proto;
htp_method method;
evhtp_res status;
#define EVHTP_REQ_FLAG_KEEPALIVE (1 << 1)
#define EVHTP_REQ_FLAG_FINISHED (1 << 2)
#define EVHTP_REQ_FLAG_CHUNKED (1 << 3)
#define EVHTP_REQ_FLAG_ERROR (1 << 4)
uint16_t flags;
evhtp_callback_cb cb;
void * cbarg;
TAILQ_ENTRY(evhtp_request) next;
};
#define evhtp_request_content_len(r) htparser_get_content_length(r->conn->parser)
struct evhtp_connection {
evhtp_t * htp;
struct event_base * evbase;
struct bufferevent * bev;
#ifndef EVHTP_DISABLE_EVTHR
evthr_t * thread;
#endif
#ifndef EVHTP_DISABLE_SSL
evhtp_ssl_t * ssl;
#endif
evhtp_hooks_t * hooks;
htparser * parser;
struct event * resume_ev;
struct sockaddr * saddr;
struct timeval recv_timeo;
struct timeval send_timeo;
evutil_socket_t sock;
evhtp_request_t * request;
uint64_t max_body_size;
uint64_t body_bytes_read;
uint64_t num_requests;
evhtp_type type;
#define EVHTP_CONN_FLAG_ERROR (1 << 1)
#define EVHTP_CONN_FLAG_OWNER (1 << 2)
#define EVHTP_CONN_FLAG_VHOST_VIA_SNI (1 << 3)
#define EVHTP_CONN_FLAG_PAUSED (1 << 4)
#define EVHTP_CONN_FLAG_CONNECTED (1 << 5)
#define EVHTP_CONN_FLAG_WAITING (1 << 6)
#define EVHTP_CONN_FLAG_FREE_CONN (1 << 7)
#define EVHTP_CONN_FLAG_KEEPALIVE (1 << 8)
uint16_t flags;
struct evbuffer * scratch_buf;
#ifdef EVHTP_FUTURE_USE
TAILQ_HEAD(, evhtp_request) pending;
#endif
};
struct evhtp_hooks {
evhtp_hook_headers_start_cb on_headers_start;
evhtp_hook_header_cb on_header;
evhtp_hook_headers_cb on_headers;
evhtp_hook_path_cb on_path;
evhtp_hook_read_cb on_read;
evhtp_hook_request_fini_cb on_request_fini;
evhtp_hook_connection_fini_cb on_connection_fini;
evhtp_hook_conn_err_cb on_connection_error;
evhtp_hook_err_cb on_error;
evhtp_hook_chunk_new_cb on_new_chunk;
evhtp_hook_chunk_fini_cb on_chunk_fini;
evhtp_hook_chunks_fini_cb on_chunks_fini;
evhtp_hook_hostname_cb on_hostname;
evhtp_hook_write_cb on_write;
evhtp_hook_event_cb on_event;
void * on_headers_start_arg;
void * on_header_arg;
void * on_headers_arg;
void * on_path_arg;
void * on_read_arg;
void * on_request_fini_arg;
void * on_connection_fini_arg;
void * on_connection_error_arg;
void * on_error_arg;
void * on_new_chunk_arg;
void * on_chunk_fini_arg;
void * on_chunks_fini_arg;
void * on_hostname_arg;
void * on_write_arg;
void * on_event_arg;
};
#ifndef EVHTP_DISABLE_SSL
struct evhtp_ssl_cfg {
char * pemfile;
char * privfile;
char * cafile;
char * capath;
char * ciphers;
char * named_curve;
char * dhparams;
long ssl_opts;
long ssl_ctx_timeout;
int verify_peer;
int verify_depth;
evhtp_ssl_verify_cb x509_verify_cb;
evhtp_ssl_chk_issued_cb x509_chk_issued_cb;
evhtp_ssl_decrypt_cb decrypt_cb;
long store_flags;
evhtp_ssl_scache_type scache_type;
long scache_timeout;
long scache_size;
evhtp_ssl_scache_init scache_init;
evhtp_ssl_scache_add scache_add;
evhtp_ssl_scache_get scache_get;
evhtp_ssl_scache_del scache_del;
void * args;
};
#endif
EVHTP_EXPORT void evhtp_set_mem_functions(void *(*malloc_)(size_t),
void *(*realloc_)(void *, size_t),
void (* free_)(void *));
EVHTP_EXPORT evhtp_t * evhtp_new(struct event_base * evbase, void * arg);
EVHTP_EXPORT void evhtp_enable_flag(evhtp_t *, int);
EVHTP_EXPORT void evhtp_connection_enable_flag(evhtp_connection_t *, int);
EVHTP_EXPORT void evhtp_request_enable_flag(evhtp_request_t *, int);
EVHTP_EXPORT int evhtp_get_flags(evhtp_t *);
EVHTP_EXPORT int evhtp_connection_get_flags(evhtp_connection_t *);
EVHTP_EXPORT int evhtp_request_get_flags(evhtp_request_t *);
EVHTP_EXPORT void evhtp_disable_flag(evhtp_t *, int);
EVHTP_EXPORT void evhtp_connection_disable_flag(evhtp_connection_t *, int);
EVHTP_EXPORT void evhtp_request_disable_flag(evhtp_request_t *, int);
EVHTP_EXPORT void evhtp_free(evhtp_t * evhtp);
EVHTP_EXPORT void evhtp_set_timeouts(evhtp_t * htp, const struct timeval * r, const struct timeval * w);
EVHTP_EXPORT void evhtp_set_parser_flags(evhtp_t * htp, int flags);
EVHTP_EXPORT void evhtp_set_bev_flags(evhtp_t * htp, int flags);
#ifndef EVHTP_DISABLE_SSL
EVHTP_EXPORT int evhtp_ssl_use_threads(void);
EVHTP_EXPORT int evhtp_ssl_init(evhtp_t * htp, evhtp_ssl_cfg_t * ssl_cfg);
#endif
EVHTP_EXPORT void evhtp_disable_100_continue(evhtp_t * htp)
DEPRECATED("evhtp_disable_100 will soon be deprecated, use htp->flags instead");
EVHTP_EXPORT int evhtp_use_callback_locks(evhtp_t * htp);
EVHTP_EXPORT void evhtp_set_gencb(evhtp_t * htp, evhtp_callback_cb cb, void * arg);
EVHTP_EXPORT void evhtp_set_pre_accept_cb(evhtp_t * htp, evhtp_pre_accept_cb, void * arg);
EVHTP_EXPORT void evhtp_set_post_accept_cb(evhtp_t * htp, evhtp_post_accept_cb, void * arg);
EVHTP_EXPORT evhtp_callback_t * evhtp_set_cb(evhtp_t * htp, const char * path,
evhtp_callback_cb cb, void * arg);
#ifndef EVHTP_DISABLE_REGEX
EVHTP_EXPORT evhtp_callback_t * evhtp_set_regex_cb(evhtp_t * htp, const char * pattern,
evhtp_callback_cb cb, void * arg);
#endif
EVHTP_EXPORT evhtp_callback_t * evhtp_set_glob_cb(evhtp_t * htp, const char * pattern,
evhtp_callback_cb cb, void * arg);
EVHTP_EXPORT evhtp_callback_t * evhtp_get_cb(evhtp_t * htp, const char * needle);
EVHTP_EXPORT int evhtp_connection_set_hook(evhtp_connection_t * c, evhtp_hook_type type, evhtp_hook cb, void * arg);
EVHTP_EXPORT int evhtp_request_set_hook(evhtp_request_t * r, evhtp_hook_type type, evhtp_hook cb, void * arg);
EVHTP_EXPORT int evhtp_callback_set_hook(evhtp_callback_t * cb, evhtp_hook_type type, evhtp_hook hookcb, void * arg);
EVHTP_EXPORT evhtp_hooks_t * evhtp_connection_get_hooks(evhtp_connection_t * c);
EVHTP_EXPORT evhtp_hooks_t * evhtp_request_get_hooks(evhtp_request_t * r);
EVHTP_EXPORT evhtp_hooks_t * evhtp_callback_get_hooks(evhtp_callback_t * cb);
EVHTP_EXPORT int evhtp_unset_all_hooks(evhtp_hooks_t ** hooks);
EVHTP_EXPORT int evhtp_request_unset_hook(evhtp_request_t * req, evhtp_hook_type type);
EVHTP_EXPORT int evhtp_connection_unset_hook(evhtp_connection_t * conn, evhtp_hook_type type);
EVHTP_EXPORT int evhtp_callback_unset_hook(evhtp_callback_t * callback, evhtp_hook_type type);
EVHTP_EXPORT int evhtp_bind_socket(evhtp_t * htp, const char * addr, uint16_t port, int backlog);
EVHTP_EXPORT void evhtp_unbind_socket(evhtp_t * htp);
EVHTP_EXPORT int evhtp_accept_socket(evhtp_t * htp, evutil_socket_t sock, int backlog);
EVHTP_EXPORT int evhtp_bind_sockaddr(evhtp_t * htp, struct sockaddr *,
size_t sin_len, int backlog);
EVHTP_EXPORT int evhtp_use_threads(evhtp_t *, evhtp_thread_init_cb, int nthreads, void *)
DEPRECATED("will take on the syntax of evhtp_use_threads_wexit");
EVHTP_EXPORT int evhtp_use_threads_wexit(evhtp_t *,
evhtp_thread_init_cb,
evhtp_thread_exit_cb,
int nthreads, void * arg);
EVHTP_EXPORT void evhtp_send_reply(evhtp_request_t * request, evhtp_res code);
/* The following three functions allow for the user to do what evhtp_send_reply does at its core
* but for the weak of heart.
*/
EVHTP_EXPORT void evhtp_send_reply_start(evhtp_request_t * request, evhtp_res code);
EVHTP_EXPORT void evhtp_send_reply_body(evhtp_request_t * request, struct evbuffer * buf);
EVHTP_EXPORT void evhtp_send_reply_end(evhtp_request_t * request);
EVHTP_EXPORT int evhtp_response_needs_body(const evhtp_res code, const htp_method method);
EVHTP_EXPORT void evhtp_send_reply_chunk_start(evhtp_request_t * request, evhtp_res code);
EVHTP_EXPORT void evhtp_send_reply_chunk(evhtp_request_t * request, struct evbuffer * buf);
EVHTP_EXPORT void evhtp_send_reply_chunk_end(evhtp_request_t * request);
EVHTP_EXPORT evhtp_callback_t *
evhtp_callback_new(const char * path, evhtp_callback_type type, evhtp_callback_cb cb, void * arg);
EVHTP_EXPORT void evhtp_callback_free(evhtp_callback_t * callback);
EVHTP_EXPORT int evhtp_callbacks_add_callback(evhtp_callbacks_t * cbs, evhtp_callback_t * cb);
EVHTP_EXPORT int evhtp_add_vhost(evhtp_t * evhtp, const char * name, evhtp_t * vhost);
EVHTP_EXPORT int evhtp_add_alias(evhtp_t * evhtp, const char * name);
EVHTP_EXPORT int evhtp_add_aliases(evhtp_t * evhtp, const char * name, ...);
EVHTP_EXPORT evhtp_kv_t * evhtp_kv_new(const char * key, const char * val, char kalloc, char valloc);
EVHTP_EXPORT evhtp_kvs_t * evhtp_kvs_new(void);
EVHTP_EXPORT void evhtp_kv_free(evhtp_kv_t * kv);
EVHTP_EXPORT void evhtp_kvs_free(evhtp_kvs_t * kvs);
EVHTP_EXPORT void evhtp_kv_rm_and_free(evhtp_kvs_t * kvs, evhtp_kv_t * kv);
EVHTP_EXPORT const char * evhtp_kv_find(evhtp_kvs_t * kvs, const char * key);
EVHTP_EXPORT evhtp_kv_t * evhtp_kvs_find_kv(evhtp_kvs_t * kvs, const char * key);
EVHTP_EXPORT void evhtp_kvs_add_kv(evhtp_kvs_t * kvs, evhtp_kv_t * kv);
EVHTP_EXPORT void evhtp_kvs_add_kvs(evhtp_kvs_t * dst, evhtp_kvs_t * src);
EVHTP_EXPORT int evhtp_kvs_for_each(evhtp_kvs_t * kvs, evhtp_kvs_iterator cb, void * arg);
#define EVHTP_PARSE_QUERY_FLAG_STRICT 0
#define EVHTP_PARSE_QUERY_FLAG_IGNORE_HEX (1 << 0)
#define EVHTP_PARSE_QUERY_FLAG_ALLOW_EMPTY_VALS (1 << 1)
#define EVHTP_PARSE_QUERY_FLAG_ALLOW_NULL_VALS (1 << 2)
#define EVHTP_PARSE_QUERY_FLAG_TREAT_SEMICOLON_AS_SEP (1 << 3)
#define EVHTP_PARSE_QUERY_FLAG_IGNORE_FRAGMENTS (1 << 4)
#define EVHTP_PARSE_QUERY_FLAG_LENIENT \
EVHTP_PARSE_QUERY_FLAG_IGNORE_HEX \
| EVHTP_PARSE_QUERY_FLAG_ALLOW_EMPTY_VALS \
| EVHTP_PARSE_QUERY_FLAG_ALLOW_NULL_VALS \
| EVHTP_PARSE_QUERY_FLAG_TREAT_SEMICOLON_AS_SEP
#define EVHTP_PARSE_QUERY_FLAG_DEFAULT EVHTP_PARSE_QUERY_FLAG_LENIENT
EVHTP_EXPORT evhtp_query_t * evhtp_parse_query_wflags(const char * query, size_t len, int flags);
EVHTP_EXPORT evhtp_query_t * evhtp_parse_query(const char * query, size_t len);
EVHTP_EXPORT int evhtp_unescape_string(unsigned char ** out, unsigned char * str, size_t str_len);
EVHTP_EXPORT evhtp_header_t * evhtp_header_new(const char * key, const char * val,
char kalloc, char valloc);
EVHTP_EXPORT evhtp_header_t * evhtp_header_key_add(evhtp_headers_t * headers,
const char * key, char kalloc);
EVHTP_EXPORT evhtp_header_t * evhtp_header_val_add(evhtp_headers_t * headers,
const char * val, char valloc);
EVHTP_EXPORT void evhtp_headers_add_header(evhtp_headers_t * headers, evhtp_header_t * header);
EVHTP_EXPORT const char * evhtp_header_find(evhtp_headers_t * headers, const char * key);
#define evhtp_headers_find_header evhtp_kvs_find_kv
#define evhtp_headers_for_each evhtp_kvs_for_each
#define evhtp_header_free evhtp_kv_free
#define evhtp_headers_new evhtp_kvs_new
#define evhtp_headers_free evhtp_kvs_free
#define evhtp_header_rm_and_free evhtp_kv_rm_and_free
#define evhtp_headers_add_headers evhtp_kvs_add_kvs
#define evhtp_query_new evhtp_kvs_new
#define evhtp_query_free evhtp_kvs_free
EVHTP_EXPORT htp_method evhtp_request_get_method(evhtp_request_t * r);
EVHTP_EXPORT evhtp_proto evhtp_request_get_proto(evhtp_request_t * r);
EVHTP_EXPORT evhtp_res evhtp_request_get_status_code(evhtp_request_t * r);
EVHTP_EXPORT const char * evhtp_request_get_status_code_str(evhtp_request_t * r);
/* the following functions all do the same thing, pause and the processing */
EVHTP_EXPORT void evhtp_connection_pause(evhtp_connection_t * connection);
EVHTP_EXPORT void evhtp_connection_resume(evhtp_connection_t * connection);
EVHTP_EXPORT void evhtp_request_pause(evhtp_request_t * request);
EVHTP_EXPORT void evhtp_request_resume(evhtp_request_t * request);
EVHTP_EXPORT evhtp_connection_t * evhtp_request_get_connection(evhtp_request_t * request);
EVHTP_EXPORT void evhtp_connection_set_bev(evhtp_connection_t * conn, struct bufferevent * bev);
EVHTP_EXPORT void evhtp_request_set_bev(evhtp_request_t * request, struct bufferevent * bev);
EVHTP_EXPORT struct bufferevent * evhtp_connection_get_bev(evhtp_connection_t * conn);
EVHTP_EXPORT void
evhtp_connection_set_timeouts(evhtp_connection_t * conn,
const struct timeval * r,
const struct timeval * w);
EVHTP_EXPORT struct bufferevent * evhtp_request_get_bev(evhtp_request_t * request);
EVHTP_EXPORT struct bufferevent * evhtp_connection_take_ownership(evhtp_connection_t * connection);
EVHTP_EXPORT void evhtp_connection_free(evhtp_connection_t * connection);
EVHTP_EXPORT void evhtp_request_free(evhtp_request_t * request);
EVHTP_EXPORT void evhtp_set_max_body_size(evhtp_t * htp, uint64_t len);
EVHTP_EXPORT void evhtp_connection_set_max_body_size(evhtp_connection_t * conn, uint64_t len);
EVHTP_EXPORT void evhtp_request_set_max_body_size(evhtp_request_t * request, uint64_t len);
EVHTP_EXPORT void evhtp_request_set_keepalive(evhtp_request_t * request, int val);
EVHTP_EXPORT void evhtp_set_max_keepalive_requests(evhtp_t * htp, uint64_t num);
/*****************************************************************
* client request functions *
*****************************************************************/
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_new_dns(
struct event_base * evbase,
struct evdns_base * dns_base,
const char * addr, uint16_t port);
EVHTP_EXPORT evhtp_connection_t *
evhtp_connection_new(struct event_base * evbase, const char * addr, uint16_t port);
#ifndef EVHTP_DISABLE_SSL
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_ssl_new(
struct event_base * evbase,
const char * addr, uint16_t port, evhtp_ssl_ctx_t * ctx);
#endif
EVHTP_EXPORT evhtp_request_t * evhtp_request_new(evhtp_callback_cb cb, void * arg);
EVHTP_EXPORT int evhtp_make_request(evhtp_connection_t * c,
evhtp_request_t * r, htp_method meth, const char * uri);
EVHTP_EXPORT unsigned int evhtp_request_status(evhtp_request_t *);
#define evhtp_safe_free(_var, _freefn) do { \
_freefn((_var)); \
(_var) = NULL; \
} while (0)
#ifdef __cplusplus
}
#endif
#endif /* __EVHTP__H__ */
evhtp_send_reply
EVHTP_EXPORT void evhtp_send_reply(evhtp_request_t *request, evhtp_res code)
generates all the right information for a reply to be sent to the client
Definition: evhtp.c:3785
evhtp_mutex_t
pthread_mutex_t evhtp_mutex_t
Definition: evhtp/evhtp.h:73
evhtp_request_get_connection
EVHTP_EXPORT evhtp_connection_t * evhtp_request_get_connection(evhtp_request_t *request)
returns the underlying evhtp_connection_t structure from a request
Definition: evhtp.c:5014
evhtp_connection_ssl_new
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_ssl_new(struct event_base *evbase, const char *addr, uint16_t port, evhtp_ssl_ctx_t *ctx)
Definition: evhtp.c:5455
evhtp_callback_get_hooks
EVHTP_EXPORT evhtp_hooks_t * evhtp_callback_get_hooks(evhtp_callback_t *cb)
returns callback hooks
Definition: evhtp.c:4483
evhtp_add_vhost
EVHTP_EXPORT int evhtp_add_vhost(evhtp_t *evhtp, const char *name, evhtp_t *vhost)
add an evhtp_t structure (with its own callbacks) to a base evhtp_t structure for virtual hosts.
Definition: evhtp.c:5232
evhtp_make_request
EVHTP_EXPORT int evhtp_make_request(evhtp_connection_t *c, evhtp_request_t *r, htp_method meth, const char *uri)
make a client request
Definition: evhtp.c:5541
evhtp_kv_find
EVHTP_EXPORT const char * evhtp_kv_find(evhtp_kvs_t *kvs, const char *key)
find the string value of 'key' from the key/value list 'kvs'
Definition: evhtp.c:3293
evhtp_connection_get_hooks
EVHTP_EXPORT evhtp_hooks_t * evhtp_connection_get_hooks(evhtp_connection_t *c)
Definition: evhtp.c:4451
evhtp_kv_rm_and_free
EVHTP_EXPORT void evhtp_kv_rm_and_free(evhtp_kvs_t *kvs, evhtp_kv_t *kv)
free's resources associated with 'kv' if ONLY found within the key/value list
Definition: evhtp.c:3237
evhtp_ssl_data_t
unsigned char evhtp_ssl_data_t
Definition: evhtp/evhtp.h:50
evhtp_hook_headers_start_cb
evhtp_res(* evhtp_hook_headers_start_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp/evhtp.h:173
evhtp_connection_get_bev
EVHTP_EXPORT struct bufferevent * evhtp_connection_get_bev(evhtp_connection_t *conn)
returns the underlying connections bufferevent
Definition: evhtp.c:4950
evhtp_response_needs_body
EVHTP_EXPORT int evhtp_response_needs_body(const evhtp_res code, const htp_method method)
Determine if a response should have a body.
Definition: evhtp.c:3811
evhtp_hook_chunk_new_cb
evhtp_res(* evhtp_hook_chunk_new_cb)(evhtp_request_t *r, uint64_t len, void *arg)
Definition: evhtp/evhtp.h:170
evhtp_send_reply_end
EVHTP_EXPORT void evhtp_send_reply_end(evhtp_request_t *request)
Definition: evhtp.c:3779
evhtp_callback_free
EVHTP_EXPORT void evhtp_callback_free(evhtp_callback_t *callback)
safely frees callback structure memory and internals
Definition: evhtp.c:4253
evhtp_use_threads
EVHTP_EXPORT int evhtp_use_threads(evhtp_t *, evhtp_thread_init_cb, int nthreads, void *) DEPRECATED("will take on the syntax of evhtp_use_threads_wexit")
Enable thread-pool support for an evhtp_t context.
Definition: evhtp.c:4594
evhtp_request_get_hooks
EVHTP_EXPORT evhtp_hooks_t * evhtp_request_get_hooks(evhtp_request_t *r)
returns request hooks
Definition: evhtp.c:4467
evhtp_set_regex_cb
EVHTP_EXPORT 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
Definition: evhtp.c:4630
evhtp_set_cb
EVHTP_EXPORT 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
Definition: evhtp.c:4489
evhtp_request_set_keepalive
EVHTP_EXPORT void evhtp_request_set_keepalive(evhtp_request_t *request, int val)
Definition: evhtp.c:5006
evhtp_set_parser_flags
EVHTP_EXPORT void evhtp_set_parser_flags(evhtp_t *htp, int flags)
during the request processing cycle, these flags will be used to for query argument parsing.
Definition: evhtp.c:5149
evhtp_new
EVHTP_EXPORT evhtp_t * evhtp_new(struct event_base *evbase, void *arg)
creates a new evhtp_t instance
Definition: evhtp.c:5318
evhtp_header_key_add
EVHTP_EXPORT 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
Definition: evhtp.c:3092
evhtp_get_cb
EVHTP_EXPORT evhtp_callback_t * evhtp_get_cb(evhtp_t *htp, const char *needle)
attempts to find the callback matching the exact string 'needle'.
Definition: evhtp.c:4524
evhtp_hook_hostname_cb
evhtp_res(* evhtp_hook_hostname_cb)(evhtp_request_t *r, const char *hostname, void *arg)
Definition: evhtp/evhtp.h:174
evhtp_request_get_proto
EVHTP_EXPORT evhtp_proto evhtp_request_get_proto(evhtp_request_t *r)
Definition: evhtp.c:5020
evhtp_connection_enable_flag
EVHTP_EXPORT void evhtp_connection_enable_flag(evhtp_connection_t *, int)
evhtp_request_free
EVHTP_EXPORT void evhtp_request_free(evhtp_request_t *request)
Definition: evhtp.c:5103
evhtp_hook_connection_fini_cb
evhtp_res(* evhtp_hook_connection_fini_cb)(evhtp_connection_t *connection, void *arg)
Definition: evhtp/evhtp.h:169
evhtp_set_mem_functions
EVHTP_EXPORT void evhtp_set_mem_functions(void *(*malloc_)(size_t), void *(*realloc_)(void *, size_t), void(*free_)(void *))
evhtp_connection_set_bev
EVHTP_EXPORT void evhtp_connection_set_bev(evhtp_connection_t *conn, struct bufferevent *bev)
Sets the connections underlying bufferevent.
Definition: evhtp.c:4994
evhtp_headers_t
struct evhtp_kvs evhtp_headers_t
Definition: evhtp/evhtp.h:94
evhtp_set_post_accept_cb
EVHTP_EXPORT void evhtp_set_post_accept_cb(evhtp_t *htp, evhtp_post_accept_cb, void *arg)
call a user-defined function right after a connection is accepted.
Definition: evhtp.c:4719
evhtp_ssl_ctx_t
SSL_CTX evhtp_ssl_ctx_t
Definition: evhtp/evhtp.h:46
evhtp_request_set_max_body_size
EVHTP_EXPORT void evhtp_request_set_max_body_size(evhtp_request_t *request, uint64_t len)
just calls evhtp_connection_set_max_body_size for the request.
Definition: evhtp.c:5060
evhtp_hook_conn_err_cb
evhtp_res(* evhtp_hook_conn_err_cb)(evhtp_connection_t *connection, evhtp_error_flags errtype, void *arg)
Definition: evhtp/evhtp.h:161
evhtp_connection_set_max_body_size
EVHTP_EXPORT void evhtp_connection_set_max_body_size(evhtp_connection_t *conn, uint64_t len)
set a max body size for a specific connection, this will default to the size set by evhtp_set_max_bod...
Definition: evhtp.c:5050
evhtp_hook_request_fini_cb
evhtp_res(* evhtp_hook_request_fini_cb)(evhtp_request_t *req, void *arg)
Definition: evhtp/evhtp.h:168
evhtp_connection_free
EVHTP_EXPORT 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 ...
Definition: evhtp.c:5066
evhtp_headers_add_header
EVHTP_EXPORT void evhtp_headers_add_header(evhtp_headers_t *headers, evhtp_header_t *header)
adds an evhtp_header_t to the end of the evhtp_headers_t tailq
Definition: evhtp.c:3317
evhtp_kvs_new
EVHTP_EXPORT evhtp_kvs_t * evhtp_kvs_new(void)
creates an empty list of key/values
Definition: evhtp.c:3140
evhtp_add_aliases
EVHTP_EXPORT int evhtp_add_aliases(evhtp_t *evhtp, const char *name,...)
set a variable number of aliases in one call @reference evhtp_add_alias
Definition: evhtp.c:5205
evhtp_ssl_scache_add
int(* evhtp_ssl_scache_add)(evhtp_connection_t *connection, evhtp_ssl_data_t *sid, int sid_len, evhtp_ssl_sess_t *sess)
Definition: evhtp/evhtp.h:185
evhtp_header_new
EVHTP_EXPORT evhtp_header_t * evhtp_header_new(const char *key, const char *val, char kalloc, char valloc)
creates a new evhtp_header_t key/val structure
Definition: evhtp.c:3323
evhtp_ssl_sess_t
SSL_SESSION evhtp_ssl_sess_t
Definition: evhtp/evhtp.h:41
evhtp_header_val_add
EVHTP_EXPORT 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
Definition: evhtp.c:3106
evhtp_ssl_scache_del
void(* evhtp_ssl_scache_del)(evhtp_t *htp, evhtp_ssl_data_t *sid, int sid_len)
Definition: evhtp/evhtp.h:186
evhtp_request_unset_hook
EVHTP_EXPORT int evhtp_request_unset_hook(evhtp_request_t *req, evhtp_hook_type type)
Definition: evhtp.c:4380
evhtp_ssl_scache_get
evhtp_ssl_sess_t *(* evhtp_ssl_scache_get)(evhtp_connection_t *connection, evhtp_ssl_data_t *sid, int sid_len)
Definition: evhtp/evhtp.h:187
evhtp_request_pause
EVHTP_EXPORT void evhtp_request_pause(evhtp_request_t *request)
Wrapper around evhtp_connection_pause.
Definition: evhtp.c:3075
evhtp_hook_path_cb
evhtp_res(* evhtp_hook_path_cb)(evhtp_request_t *req, evhtp_path_t *path, void *arg)
Definition: evhtp/evhtp.h:166
evhtp_set_pre_accept_cb
EVHTP_EXPORT void evhtp_set_pre_accept_cb(evhtp_t *htp, evhtp_pre_accept_cb, void *arg)
call a user-defined function before the connection is accepted.
Definition: evhtp.c:4712
evhtp_send_reply_chunk
EVHTP_EXPORT void evhtp_send_reply_chunk(evhtp_request_t *request, struct evbuffer *buf)
send a chunk reply.
Definition: evhtp.c:3888
evhtp_callback_cb
void(* evhtp_callback_cb)(evhtp_request_t *req, void *arg)
Definition: evhtp/evhtp.h:154
evhtp_connection_disable_flag
EVHTP_EXPORT void evhtp_connection_disable_flag(evhtp_connection_t *, int)
evhtp_set_glob_cb
EVHTP_EXPORT 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...
Definition: evhtp.c:4670
evhtp_enable_flag
EVHTP_EXPORT void evhtp_enable_flag(evhtp_t *, int)
evhtp_send_reply_start
EVHTP_EXPORT void evhtp_send_reply_start(evhtp_request_t *request, evhtp_res code)
Definition: evhtp.c:3752
evhtp_connection_take_ownership
EVHTP_EXPORT struct bufferevent * evhtp_connection_take_ownership(evhtp_connection_t *connection)
let a user take ownership of the underlying bufferevent and free all other underlying resources.
Definition: evhtp.c:4956
evhtp_set_max_keepalive_requests
EVHTP_EXPORT void evhtp_set_max_keepalive_requests(evhtp_t *htp, uint64_t num)
sets a maximum number of requests that a single connection can make.
Definition: evhtp.c:5125
evhtp_post_accept_cb
evhtp_res(* evhtp_post_accept_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp/evhtp.h:163
evhtp_unescape_string
EVHTP_EXPORT 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}'.
Definition: evhtp.c:3413
evhtp_callback_type
evhtp_callback_type
Definition: evhtp/evhtp.h:127
evhtp_callback_type_glob
@ evhtp_callback_type_glob
Definition: evhtp/evhtp.h:129
evhtp_callback_type_hash
@ evhtp_callback_type_hash
Definition: evhtp/evhtp.h:128
evhtp_callback_type_regex
@ evhtp_callback_type_regex
Definition: evhtp/evhtp.h:131
evhtp_request_enable_flag
EVHTP_EXPORT void evhtp_request_enable_flag(evhtp_request_t *, int)
evhtp_bind_socket
EVHTP_EXPORT int evhtp_bind_socket(evhtp_t *htp, const char *addr, uint16_t port, int backlog)
bind to a socket, optionally with specific protocol support formatting.
Definition: evhtp.c:4114
evhtp_connection_resume
EVHTP_EXPORT void evhtp_connection_resume(evhtp_connection_t *connection)
resumes a connection (enables reading) and activates resume event.
Definition: evhtp.c:3056
evhtp_request_get_method
EVHTP_EXPORT htp_method evhtp_request_get_method(evhtp_request_t *r)
returns the htp_method enum version of the request method.
Definition: evhtp.c:3024
evhtp_hook_chunks_fini_cb
evhtp_res(* evhtp_hook_chunks_fini_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp/evhtp.h:172
instead
EVHTP_EXPORT void use htp flags instead
Definition: evhtp/evhtp.h:611
evbuf_t
struct evbuffer evbuf_t
Definition: evhtp/evhtp.h:62
evhtp_callback_set_hook
EVHTP_EXPORT int evhtp_callback_set_hook(evhtp_callback_t *cb, evhtp_hook_type type, evhtp_hook hookcb, void *arg)
Definition: evhtp.c:4392
evhtp_connection_new
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_new(struct event_base *evbase, const char *addr, uint16_t port)
allocate a new connection
Definition: evhtp.c:5378
evhtp_add_alias
EVHTP_EXPORT int evhtp_add_alias(evhtp_t *evhtp, const char *name)
Add an alias hostname for a virtual-host specific evhtp_t.
Definition: evhtp.c:5177
evhtp_request_resume
EVHTP_EXPORT void evhtp_request_resume(evhtp_request_t *request)
Wrapper around evhtp_connection_resume.
Definition: evhtp.c:3084
evhtp_free
EVHTP_EXPORT void evhtp_free(evhtp_t *evhtp)
Frees evhtp_t structure; will stop and free threads associated with the structure,...
Definition: evhtp.c:5330
evhtp_hook_type
evhtp_hook_type
types associated with where a developer can hook into during the request processing cycle.
Definition: evhtp/evhtp.h:108
evhtp_hook_on_error
@ evhtp_hook_on_error
type which defines to hook whenever an error occurs
Definition: evhtp/evhtp.h:119
evhtp_hook_on_header
@ evhtp_hook_on_header
type which defines to hook after one header has been parsed
Definition: evhtp/evhtp.h:109
evhtp_hook_on_read
@ evhtp_hook_on_read
type which defines to hook whenever the parser recieves data in a body
Definition: evhtp/evhtp.h:112
evhtp_hook_on_new_chunk
@ evhtp_hook_on_new_chunk
Definition: evhtp/evhtp.h:115
evhtp_hook_on_chunk_complete
@ evhtp_hook_on_chunk_complete
Definition: evhtp/evhtp.h:116
evhtp_hook_on_write
@ evhtp_hook_on_write
Definition: evhtp/evhtp.h:121
evhtp_hook_on_request_fini
@ evhtp_hook_on_request_fini
type which defines to hook before the request is free'd
Definition: evhtp/evhtp.h:113
evhtp_hook_on_hostname
@ evhtp_hook_on_hostname
Definition: evhtp/evhtp.h:120
evhtp_hook_on_chunks_complete
@ evhtp_hook_on_chunks_complete
Definition: evhtp/evhtp.h:117
evhtp_hook_on_event
@ evhtp_hook_on_event
Definition: evhtp/evhtp.h:122
evhtp_hook_on_conn_error
@ evhtp_hook_on_conn_error
type which defines to hook whenever a connection error occurs
Definition: evhtp/evhtp.h:123
evhtp_hook_on_headers_start
@ evhtp_hook_on_headers_start
Definition: evhtp/evhtp.h:118
evhtp_hook_on_path
@ evhtp_hook_on_path
type which defines to hook once a path has been parsed
Definition: evhtp/evhtp.h:111
evhtp_hook_on_connection_fini
@ evhtp_hook_on_connection_fini
Definition: evhtp/evhtp.h:114
evhtp_hook_on_headers
@ evhtp_hook_on_headers
type which defines to hook after all headers have been parsed
Definition: evhtp/evhtp.h:110
evhtp_hook__max
@ evhtp_hook__max
Definition: evhtp/evhtp.h:124
evhtp_ssl_t
SSL evhtp_ssl_t
Definition: evhtp/evhtp.h:45
evhtp_connection_pause
EVHTP_EXPORT void evhtp_connection_pause(evhtp_connection_t *connection)
pauses a connection (disables reading)
Definition: evhtp.c:3034
evhtp_hook_read_cb
evhtp_res(* evhtp_hook_read_cb)(evhtp_request_t *req, struct evbuffer *buf, void *arg)
Definition: evhtp/evhtp.h:167
evhtp_header_find
EVHTP_EXPORT const char * evhtp_header_find(evhtp_headers_t *headers, const char *key)
finds the value of a key in a evhtp_headers_t structure
Definition: evhtp.c:3311
evhtp_set_bev_flags
EVHTP_EXPORT void evhtp_set_bev_flags(evhtp_t *htp, int flags)
bufferevent flags which will be used for bev sockets.
Definition: evhtp.c:5131
evhtp_accept_socket
EVHTP_EXPORT int evhtp_accept_socket(evhtp_t *htp, evutil_socket_t sock, int backlog)
create the listener plus setup various options with an already-bound socket.
Definition: evhtp.c:3997
evhtp_set_timeouts
EVHTP_EXPORT void evhtp_set_timeouts(evhtp_t *htp, const struct timeval *r, const struct timeval *w)
set a read/write timeout on all things evhtp_t.
Definition: evhtp.c:5113
TAILQ_HEAD
TAILQ_HEAD(evhtp_kvs, evhtp_kv)
evhtp_kv_free
EVHTP_EXPORT void evhtp_kv_free(evhtp_kv_t *kv)
frees resources allocated for a single key/value
Definition: evhtp.c:3219
evhtp_unbind_socket
EVHTP_EXPORT void evhtp_unbind_socket(evhtp_t *htp)
stops the listening socket.
Definition: evhtp.c:3924
evhtp_hook_header_cb
evhtp_res(* evhtp_hook_header_cb)(evhtp_request_t *req, evhtp_header_t *hdr, void *arg)
Definition: evhtp/evhtp.h:164
evhtp_kvs_find_kv
EVHTP_EXPORT evhtp_kv_t * evhtp_kvs_find_kv(evhtp_kvs_t *kvs, const char *key)
find the evhtp_kv_t reference 'key' from the k/val list 'kvs'
Definition: evhtp.c:3329
evhtp_ssl_chk_issued_cb
int(* evhtp_ssl_chk_issued_cb)(evhtp_x509_store_ctx_t *ctx, evhtp_x509_t *x, evhtp_x509_t *issuer)
Definition: evhtp/evhtp.h:182
evhtp_error_flags
uint8_t evhtp_error_flags
Definition: evhtp/evhtp.h:91
evhtp_request_get_status_code
EVHTP_EXPORT evhtp_res evhtp_request_get_status_code(evhtp_request_t *r)
Returns the last status code set for a request (request/response)
Definition: evhtp.c:5026
evhtp_connection_unset_hook
EVHTP_EXPORT int evhtp_connection_unset_hook(evhtp_connection_t *conn, evhtp_hook_type type)
Definition: evhtp.c:4386
evhtp_bind_sockaddr
EVHTP_EXPORT int evhtp_bind_sockaddr(evhtp_t *htp, struct sockaddr *, size_t sin_len, int backlog)
bind to an already allocated sockaddr.
Definition: evhtp.c:4047
evhtp_connection_set_timeouts
EVHTP_EXPORT void evhtp_connection_set_timeouts(evhtp_connection_t *conn, const struct timeval *r, const struct timeval *w)
sets a connection-specific read/write timeout which overrides the global read/write settings.
Definition: evhtp.c:5038
evhtp_request_get_bev
EVHTP_EXPORT struct bufferevent * evhtp_request_get_bev(evhtp_request_t *request)
returns the underlying requests bufferevent
Definition: evhtp.c:4982
evhtp_x509_store_ctx_t
X509_STORE_CTX evhtp_x509_store_ctx_t
Definition: evhtp/evhtp.h:48
evhtp_use_callback_locks
EVHTP_EXPORT int evhtp_use_callback_locks(evhtp_t *htp)
creates a lock around callbacks and hooks, allowing for threaded applications to add/remove/modify ho...
Definition: evhtp.c:4613
evhtp_request_disable_flag
EVHTP_EXPORT void evhtp_request_disable_flag(evhtp_request_t *, int)
evhtp_kvs_for_each
EVHTP_EXPORT int evhtp_kvs_for_each(evhtp_kvs_t *kvs, evhtp_kvs_iterator cb, void *arg)
callback iterator which executes 'cb' for every entry in 'kvs'
Definition: evhtp.c:3273
evhtp_hook
evhtp_res(* evhtp_hook)()
Definition: evhtp/evhtp.h:159
evhtp_kvs_add_kvs
EVHTP_EXPORT void evhtp_kvs_add_kvs(evhtp_kvs_t *dst, evhtp_kvs_t *src)
appends all key/val structures from src tailq onto dst tailq
Definition: evhtp.c:3357
evhtp_kvs_free
EVHTP_EXPORT void evhtp_kvs_free(evhtp_kvs_t *kvs)
frees a the list of key/values, and all underlying entries
Definition: evhtp.c:3249
evhtp_request_set_hook
EVHTP_EXPORT int evhtp_request_set_hook(evhtp_request_t *r, evhtp_hook_type type, evhtp_hook cb, void *arg)
Definition: evhtp.c:4399
evhtp_kvs_iterator
int(* evhtp_kvs_iterator)(evhtp_kv_t *kv, void *arg)
Definition: evhtp/evhtp.h:177
evhtp_request_get_status_code_str
EVHTP_EXPORT const char * evhtp_request_get_status_code_str(evhtp_request_t *r)
wrapper around get_status_code that returns the string version of the last status code set for a requ...
Definition: evhtp.c:5032
evhtp_ssl_scache_type
evhtp_ssl_scache_type
Definition: evhtp/evhtp.h:97
evhtp_ssl_scache_type_user
@ evhtp_ssl_scache_type_user
Definition: evhtp/evhtp.h:100
evhtp_ssl_scache_type_builtin
@ evhtp_ssl_scache_type_builtin
Definition: evhtp/evhtp.h:101
evhtp_ssl_scache_type_internal
@ evhtp_ssl_scache_type_internal
Definition: evhtp/evhtp.h:99
evhtp_ssl_scache_type_disabled
@ evhtp_ssl_scache_type_disabled
Definition: evhtp/evhtp.h:98
evhtp_hook_chunk_fini_cb
evhtp_res(* evhtp_hook_chunk_fini_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp/evhtp.h:171
evhtp_kvs_add_kv
EVHTP_EXPORT void evhtp_kvs_add_kv(evhtp_kvs_t *kvs, evhtp_kv_t *kv)
appends a key/val structure to a evhtp_kvs_t tailq
Definition: evhtp.c:3347
evhtp_disable_100_continue
EVHTP_EXPORT void evhtp_disable_100_continue(evhtp_t *htp) DEPRECATED("evhtp_disable_100 will soon be deprecated
when a client sends an Expect: 100-continue, if this is function is called, evhtp will not send a HTT...
evhtp_ssl_verify_cb
int(* evhtp_ssl_verify_cb)(int pre_verify, evhtp_x509_store_ctx_t *ctx)
Definition: evhtp/evhtp.h:181
evhtp_hook_headers_cb
evhtp_res(* evhtp_hook_headers_cb)(evhtp_request_t *req, evhtp_headers_t *hdr, void *arg)
Definition: evhtp/evhtp.h:165
evhtp_pre_accept_cb
evhtp_res(* evhtp_pre_accept_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp/evhtp.h:162
evhtp_hook_err_cb
void(* evhtp_hook_err_cb)(evhtp_request_t *req, evhtp_error_flags errtype, void *arg)
Definition: evhtp/evhtp.h:155
evhtp_thread_exit_cb
void(* evhtp_thread_exit_cb)(evhtp_t *htp, evthr_t *thr, void *arg)
Definition: evhtp/evhtp.h:153
evhtp_kvs_t
struct evhtp_kvs evhtp_kvs_t
Definition: evhtp/evhtp.h:81
evhtp_set_gencb
EVHTP_EXPORT 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
Definition: evhtp.c:4705
evhtp_request_get_flags
EVHTP_EXPORT int evhtp_request_get_flags(evhtp_request_t *)
evhtp_proto
evhtp_proto
Definition: evhtp/evhtp.h:135
EVHTP_PROTO_10
@ EVHTP_PROTO_10
Definition: evhtp/evhtp.h:137
EVHTP_PROTO_INVALID
@ EVHTP_PROTO_INVALID
Definition: evhtp/evhtp.h:136
EVHTP_PROTO_11
@ EVHTP_PROTO_11
Definition: evhtp/evhtp.h:138
evhtp_connection_get_flags
EVHTP_EXPORT int evhtp_connection_get_flags(evhtp_connection_t *)
evhtp_unset_all_hooks
EVHTP_EXPORT int evhtp_unset_all_hooks(evhtp_hooks_t **hooks)
removes all hooks.
Definition: evhtp.c:4412
evhtp_use_threads_wexit
EVHTP_EXPORT int evhtp_use_threads_wexit(evhtp_t *, evhtp_thread_init_cb, evhtp_thread_exit_cb, int nthreads, void *arg)
Temporary function which will be renamed evhtp_use_threads in the future.
Definition: evhtp.c:4601
evhtp_callback_unset_hook
EVHTP_EXPORT int evhtp_callback_unset_hook(evhtp_callback_t *callback, evhtp_hook_type type)
Definition: evhtp.c:4374
evhtp_request_new
EVHTP_EXPORT evhtp_request_t * evhtp_request_new(evhtp_callback_cb cb, void *arg)
allocate a new request
Definition: evhtp.c:5526
evhtp_send_reply_body
EVHTP_EXPORT void evhtp_send_reply_body(evhtp_request_t *request, struct evbuffer *buf)
Definition: evhtp.c:3769
evhtp_res
uint16_t evhtp_res
Definition: evhtp/evhtp.h:90
evhtp_hook_write_cb
evhtp_res(* evhtp_hook_write_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp/evhtp.h:175
evhtp_parse_query
EVHTP_EXPORT 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 in a strict manner.
Definition: evhtp.c:3745
evhtp_request_set_bev
EVHTP_EXPORT void evhtp_request_set_bev(evhtp_request_t *request, struct bufferevent *bev)
sets the underlying bufferevent for a evhtp_request
Definition: evhtp.c:5000
evhtp_headers_iterator
#define evhtp_headers_iterator
Definition: evhtp/evhtp.h:197
evserv_t
struct evconnlistener evserv_t
Definition: evhtp/evhtp.h:64
evhtp_ssl_init
EVHTP_EXPORT int evhtp_ssl_init(evhtp_t *htp, evhtp_ssl_cfg_t *ssl_cfg)
Definition: evhtp.c:4762
evhtp_x509_t
X509 evhtp_x509_t
Definition: evhtp/evhtp.h:47
evhtp_get_flags
EVHTP_EXPORT int evhtp_get_flags(evhtp_t *)
event_t
struct event event_t
Definition: evhtp/evhtp.h:63
evhtp_callback_new
EVHTP_EXPORT 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.
Definition: evhtp.c:4186
evhtp_connection_set_hook
EVHTP_EXPORT int evhtp_connection_set_hook(evhtp_connection_t *c, evhtp_hook_type type, evhtp_hook cb, void *arg)
sets a callback hook for either a connection or a path/regex .
Definition: evhtp.c:4405
evhtp_connection_new_dns
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_new_dns(struct event_base *evbase, struct evdns_base *dns_base, const char *addr, uint16_t port)
allocate a new connection
Definition: evhtp.c:5384
evhtp_ssl_use_threads
EVHTP_EXPORT int evhtp_ssl_use_threads(void)
Definition: evhtp.c:4728
evhtp_ssl_decrypt_cb
EVP_PKEY *(* evhtp_ssl_decrypt_cb)(char *privfile)
Definition: evhtp/evhtp.h:183
evhtp_send_reply_chunk_end
EVHTP_EXPORT 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.
Definition: evhtp.c:3913
evhtp_disable_flag
EVHTP_EXPORT void evhtp_disable_flag(evhtp_t *, int)
evhtp_thread_init_cb
void(* evhtp_thread_init_cb)(evhtp_t *htp, evthr_t *thr, void *arg)
Definition: evhtp/evhtp.h:152
evhtp_request_status
EVHTP_EXPORT unsigned int evhtp_request_status(evhtp_request_t *)
Definition: evhtp.c:5589
evhtp_query_t
struct evhtp_kvs evhtp_query_t
Definition: evhtp/evhtp.h:95
evhtp_callbacks_add_callback
EVHTP_EXPORT int evhtp_callbacks_add_callback(evhtp_callbacks_t *cbs, evhtp_callback_t *cb)
Adds a evhtp_callback_t to the evhtp_callbacks_t list.
Definition: evhtp.c:4283
evhtp_type
evhtp_type
Definition: evhtp/evhtp.h:141
evhtp_type_server
@ evhtp_type_server
Definition: evhtp/evhtp.h:143
evhtp_type_client
@ evhtp_type_client
Definition: evhtp/evhtp.h:142
evhtp_hook_event_cb
void(* evhtp_hook_event_cb)(evhtp_connection_t *conn, short events, void *arg)
Definition: evhtp/evhtp.h:156
evhtp_callbacks_t
struct evhtp_callbacks evhtp_callbacks_t
Definition: evhtp/evhtp.h:78
evhtp_kv_new
EVHTP_EXPORT evhtp_kv_t * evhtp_kv_new(const char *key, const char *val, char kalloc, char valloc)
Allocates a new key/value structure.
Definition: evhtp.c:3156
evhtp_ssl_scache_init
void *(* evhtp_ssl_scache_init)(evhtp_t *)
Definition: evhtp/evhtp.h:189
evbev_t
struct bufferevent evbev_t
Definition: evhtp/evhtp.h:65
evhtp_send_reply_chunk_start
EVHTP_EXPORT void evhtp_send_reply_chunk_start(evhtp_request_t *request, evhtp_res code)
start a chunked response.
Definition: evhtp.c:3820
evhtp_set_max_body_size
EVHTP_EXPORT 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.
Definition: evhtp.c:5137
evhtp_parse_query_wflags
EVHTP_EXPORT evhtp_query_t * evhtp_parse_query_wflags(const char *query, size_t len, int flags)
Parses the query portion of the uri into a set of key/values.
Definition: evhtp.c:3486
realloc_
static void *(* realloc_)(void *d, size_t sz)
Definition: evhtp.c:167
free_
static void(* free_)(void *d)
Definition: evhtp.c:168
malloc_
static void *(* malloc_)(size_t sz)
Definition: evhtp.c:166
evhtp_alias
Definition: evhtp/evhtp.h:273
evhtp_alias::TAILQ_ENTRY
TAILQ_ENTRY(evhtp_alias) next
evhtp_alias::alias
char * alias
Definition: evhtp/evhtp.h:274
evhtp_authority
structure which represents authority information in a URI
Definition: evhtp/evhtp.h:372
evhtp_authority::password
char * password
the password in URI (scheme://...:PASS.
Definition: evhtp/evhtp.h:374
evhtp_authority::port
uint16_t port
port if present in URI
Definition: evhtp/evhtp.h:376
evhtp_authority::hostname
char * hostname
hostname if present in URI
Definition: evhtp/evhtp.h:375
evhtp_authority::username
char * username
the username in URI (scheme://USER:.
Definition: evhtp/evhtp.h:373
evhtp_callback
structure containing a single callback and configuration
Definition: evhtp.c:51
evhtp_connection
Definition: evhtp/evhtp.h:427
evhtp_connection::num_requests
uint64_t num_requests
Definition: evhtp/evhtp.h:447
evhtp_connection::thread
evthr_t * thread
Definition: evhtp/evhtp.h:432
evhtp_connection::max_body_size
uint64_t max_body_size
Definition: evhtp/evhtp.h:445
evhtp_connection::saddr
struct sockaddr * saddr
Definition: evhtp/evhtp.h:440
evhtp_connection::send_timeo
struct timeval send_timeo
conn write timeouts (overrides global)
Definition: evhtp/evhtp.h:442
evhtp_connection::htp
evhtp_t * htp
Definition: evhtp/evhtp.h:428
evhtp_connection::resume_ev
struct event * resume_ev
Definition: evhtp/evhtp.h:439
evhtp_connection::ssl
evhtp_ssl_t * ssl
Definition: evhtp/evhtp.h:435
evhtp_connection::recv_timeo
struct timeval recv_timeo
conn read timeouts (overrides global)
Definition: evhtp/evhtp.h:441
evhtp_connection::type
evhtp_type type
server or client
Definition: evhtp/evhtp.h:448
evhtp_connection::request
evhtp_request_t * request
the request currently being processed
Definition: evhtp/evhtp.h:444
evhtp_connection::sock
evutil_socket_t sock
Definition: evhtp/evhtp.h:443
evhtp_connection::parser
htparser * parser
Definition: evhtp/evhtp.h:438
evhtp_connection::flags
uint16_t flags
Definition: evhtp/evhtp.h:457
evhtp_connection::body_bytes_read
uint64_t body_bytes_read
Definition: evhtp/evhtp.h:446
evhtp_connection::hooks
evhtp_hooks_t * hooks
Definition: evhtp/evhtp.h:437
evhtp_connection::bev
struct bufferevent * bev
Definition: evhtp/evhtp.h:430
evhtp_connection::evbase
struct event_base * evbase
Definition: evhtp/evhtp.h:429
evhtp_connection::scratch_buf
struct evbuffer * scratch_buf
always zero'd out after used
Definition: evhtp/evhtp.h:459
evhtp_defaults
Definition: evhtp/evhtp.h:264
evhtp_defaults::post_accept_cbarg
void * post_accept_cbarg
Definition: evhtp/evhtp.h:270
evhtp_defaults::cb
evhtp_callback_cb cb
Definition: evhtp/evhtp.h:265
evhtp_defaults::cbarg
void * cbarg
Definition: evhtp/evhtp.h:268
evhtp_defaults::post_accept
evhtp_post_accept_cb post_accept
Definition: evhtp/evhtp.h:267
evhtp_defaults::pre_accept
evhtp_pre_accept_cb pre_accept
Definition: evhtp/evhtp.h:266
evhtp_defaults::pre_accept_cbarg
void * pre_accept_cbarg
Definition: evhtp/evhtp.h:269
evhtp_hooks
Definition: evhtp/evhtp.h:466
evhtp_hooks::on_new_chunk_arg
void * on_new_chunk_arg
Definition: evhtp/evhtp.h:492
evhtp_hooks::on_request_fini_arg
void * on_request_fini_arg
Definition: evhtp/evhtp.h:488
evhtp_hooks::on_request_fini
evhtp_hook_request_fini_cb on_request_fini
Definition: evhtp/evhtp.h:472
evhtp_hooks::on_connection_error
evhtp_hook_conn_err_cb on_connection_error
Definition: evhtp/evhtp.h:474
evhtp_hooks::on_chunks_fini
evhtp_hook_chunks_fini_cb on_chunks_fini
Definition: evhtp/evhtp.h:478
evhtp_hooks::on_headers_arg
void * on_headers_arg
Definition: evhtp/evhtp.h:485
evhtp_hooks::on_chunks_fini_arg
void * on_chunks_fini_arg
Definition: evhtp/evhtp.h:494
evhtp_hooks::on_connection_fini
evhtp_hook_connection_fini_cb on_connection_fini
Definition: evhtp/evhtp.h:473
evhtp_hooks::on_connection_fini_arg
void * on_connection_fini_arg
Definition: evhtp/evhtp.h:489
evhtp_hooks::on_headers
evhtp_hook_headers_cb on_headers
Definition: evhtp/evhtp.h:469
evhtp_hooks::on_write
evhtp_hook_write_cb on_write
Definition: evhtp/evhtp.h:480
evhtp_hooks::on_hostname_arg
void * on_hostname_arg
Definition: evhtp/evhtp.h:495
evhtp_hooks::on_headers_start_arg
void * on_headers_start_arg
Definition: evhtp/evhtp.h:483
evhtp_hooks::on_path_arg
void * on_path_arg
Definition: evhtp/evhtp.h:486
evhtp_hooks::on_path
evhtp_hook_path_cb on_path
Definition: evhtp/evhtp.h:470
evhtp_hooks::on_write_arg
void * on_write_arg
Definition: evhtp/evhtp.h:496
evhtp_hooks::on_error
evhtp_hook_err_cb on_error
Definition: evhtp/evhtp.h:475
evhtp_hooks::on_chunk_fini
evhtp_hook_chunk_fini_cb on_chunk_fini
Definition: evhtp/evhtp.h:477
evhtp_hooks::on_event
evhtp_hook_event_cb on_event
Definition: evhtp/evhtp.h:481
evhtp_hooks::on_header
evhtp_hook_header_cb on_header
Definition: evhtp/evhtp.h:468
evhtp_hooks::on_header_arg
void * on_header_arg
Definition: evhtp/evhtp.h:484
evhtp_hooks::on_chunk_fini_arg
void * on_chunk_fini_arg
Definition: evhtp/evhtp.h:493
evhtp_hooks::on_new_chunk
evhtp_hook_chunk_new_cb on_new_chunk
Definition: evhtp/evhtp.h:476
evhtp_hooks::on_read_arg
void * on_read_arg
Definition: evhtp/evhtp.h:487
evhtp_hooks::on_event_arg
void * on_event_arg
Definition: evhtp/evhtp.h:497
evhtp_hooks::on_headers_start
evhtp_hook_headers_start_cb on_headers_start
Definition: evhtp/evhtp.h:467
evhtp_hooks::on_error_arg
void * on_error_arg
Definition: evhtp/evhtp.h:491
evhtp_hooks::on_hostname
evhtp_hook_hostname_cb on_hostname
Definition: evhtp/evhtp.h:479
evhtp_hooks::on_connection_error_arg
void * on_connection_error_arg
Definition: evhtp/evhtp.h:490
evhtp_hooks::on_read
evhtp_hook_read_cb on_read
Definition: evhtp/evhtp.h:471
evhtp_kv
a generic key/value structure
Definition: evhtp/evhtp.h:339
evhtp_kv::key
char * key
Definition: evhtp/evhtp.h:340
evhtp_kv::TAILQ_ENTRY
TAILQ_ENTRY(evhtp_kv) next
evhtp_kv::v_heaped
char v_heaped
set to 1 if the val can be free()'d
Definition: evhtp/evhtp.h:347
evhtp_kv::k_heaped
char k_heaped
set to 1 if the key can be free()'d
Definition: evhtp/evhtp.h:346
evhtp_kv::val
char * val
Definition: evhtp/evhtp.h:341
evhtp_kv::vlen
size_t vlen
Definition: evhtp/evhtp.h:344
evhtp_kv::klen
size_t klen
Definition: evhtp/evhtp.h:343
evhtp_path
structure which represents a URI path and or file
Definition: evhtp/evhtp.h:383
evhtp_path::file
char * file
the filename if present (c.html)
Definition: evhtp/evhtp.h:386
evhtp_path::match_start
char * match_start
Definition: evhtp/evhtp.h:387
evhtp_path::full
char * full
the full path+file (/a/b/c.html)
Definition: evhtp/evhtp.h:384
evhtp_path::match_end
char * match_end
Definition: evhtp/evhtp.h:388
evhtp_path::matched_eoff
unsigned int matched_eoff
offset of where the uri ends mainly used for regex matching
Definition: evhtp/evhtp.h:392
evhtp_path::matched_soff
unsigned int matched_soff
offset of where the uri starts mainly used for regex matching
Definition: evhtp/evhtp.h:389
evhtp_path::path
char * path
the path (/a/b/)
Definition: evhtp/evhtp.h:385
evhtp_request
a structure containing all information for a http request.
Definition: evhtp/evhtp.h:401
evhtp_request::buffer_in
struct evbuffer * buffer_in
buffer containing data from client
Definition: evhtp/evhtp.h:406
evhtp_request::cbarg
void * cbarg
argument which is passed to the cb function
Definition: evhtp/evhtp.h:420
evhtp_request::cb
evhtp_callback_cb cb
the function to call when fully processed
Definition: evhtp/evhtp.h:419
evhtp_request::uri
evhtp_uri_t * uri
request URI information
Definition: evhtp/evhtp.h:405
evhtp_request::method
htp_method method
HTTP method used.
Definition: evhtp/evhtp.h:411
evhtp_request::TAILQ_ENTRY
TAILQ_ENTRY(evhtp_request) next
evhtp_request::buffer_out
struct evbuffer * buffer_out
buffer containing data to client
Definition: evhtp/evhtp.h:407
evhtp_request::headers_out
evhtp_headers_t * headers_out
headers to client
Definition: evhtp/evhtp.h:409
evhtp_request::headers_in
evhtp_headers_t * headers_in
headers from client
Definition: evhtp/evhtp.h:408
evhtp_request::htp
evhtp_t * htp
the parent evhtp_t structure
Definition: evhtp/evhtp.h:402
evhtp_request::hooks
evhtp_hooks_t * hooks
request specific hooks
Definition: evhtp/evhtp.h:404
evhtp_request::flags
uint16_t flags
Definition: evhtp/evhtp.h:417
evhtp_request::status
evhtp_res status
The HTTP response code or other error conditions.
Definition: evhtp/evhtp.h:412
evhtp_request::conn
evhtp_connection_t * conn
the associated connection
Definition: evhtp/evhtp.h:403
evhtp_request::proto
evhtp_proto proto
HTTP protocol used.
Definition: evhtp/evhtp.h:410
evhtp_ssl_cfg
Definition: evhtp/evhtp.h:501
evhtp_ssl_cfg::scache_get
evhtp_ssl_scache_get scache_get
Definition: evhtp/evhtp.h:522
evhtp_ssl_cfg::x509_verify_cb
evhtp_ssl_verify_cb x509_verify_cb
Definition: evhtp/evhtp.h:513
evhtp_ssl_cfg::privfile
char * privfile
Definition: evhtp/evhtp.h:503
evhtp_ssl_cfg::scache_size
long scache_size
Definition: evhtp/evhtp.h:519
evhtp_ssl_cfg::decrypt_cb
evhtp_ssl_decrypt_cb decrypt_cb
Definition: evhtp/evhtp.h:515
evhtp_ssl_cfg::args
void * args
Definition: evhtp/evhtp.h:524
evhtp_ssl_cfg::verify_depth
int verify_depth
Definition: evhtp/evhtp.h:512
evhtp_ssl_cfg::ciphers
char * ciphers
Definition: evhtp/evhtp.h:506
evhtp_ssl_cfg::scache_type
evhtp_ssl_scache_type scache_type
Definition: evhtp/evhtp.h:517
evhtp_ssl_cfg::verify_peer
int verify_peer
Definition: evhtp/evhtp.h:511
evhtp_ssl_cfg::ssl_ctx_timeout
long ssl_ctx_timeout
Definition: evhtp/evhtp.h:510
evhtp_ssl_cfg::cafile
char * cafile
Definition: evhtp/evhtp.h:504
evhtp_ssl_cfg::named_curve
char * named_curve
Definition: evhtp/evhtp.h:507
evhtp_ssl_cfg::scache_timeout
long scache_timeout
Definition: evhtp/evhtp.h:518
evhtp_ssl_cfg::pemfile
char * pemfile
Definition: evhtp/evhtp.h:502
evhtp_ssl_cfg::ssl_opts
long ssl_opts
Definition: evhtp/evhtp.h:509
evhtp_ssl_cfg::dhparams
char * dhparams
Definition: evhtp/evhtp.h:508
evhtp_ssl_cfg::store_flags
long store_flags
Definition: evhtp/evhtp.h:516
evhtp_ssl_cfg::capath
char * capath
Definition: evhtp/evhtp.h:505
evhtp_ssl_cfg::scache_del
evhtp_ssl_scache_del scache_del
Definition: evhtp/evhtp.h:523
evhtp_ssl_cfg::scache_add
evhtp_ssl_scache_add scache_add
Definition: evhtp/evhtp.h:521
evhtp_ssl_cfg::x509_chk_issued_cb
evhtp_ssl_chk_issued_cb x509_chk_issued_cb
Definition: evhtp/evhtp.h:514
evhtp_ssl_cfg::scache_init
evhtp_ssl_scache_init scache_init
Definition: evhtp/evhtp.h:520
evhtp_uri
a generic container representing an entire URI strucutre
Definition: evhtp/evhtp.h:359
evhtp_uri::fragment
unsigned char * fragment
data after '#' in uri
Definition: evhtp/evhtp.h:362
evhtp_uri::path
evhtp_path_t * path
Definition: evhtp/evhtp.h:361
evhtp_uri::query_raw
unsigned char * query_raw
the unparsed query arguments
Definition: evhtp/evhtp.h:363
evhtp_uri::scheme
htp_scheme scheme
set if a scheme is found
Definition: evhtp/evhtp.h:365
evhtp_uri::authority
evhtp_authority_t * authority
Definition: evhtp/evhtp.h:360
evhtp_uri::query
evhtp_query_t * query
list of k/v for query arguments
Definition: evhtp/evhtp.h:364
evhtp
main structure containing all configuration information
Definition: evhtp/evhtp.h:283
evhtp::TAILQ_HEAD
TAILQ_HEAD(, evhtp) vhosts
evhtp::thread_exit_cb
evhtp_thread_exit_cb thread_exit_cb
Definition: evhtp/evhtp.h:316
evhtp::server_name
char * server_name
the name included in Host: responses
Definition: evhtp/evhtp.h:287
evhtp::thread_cbarg
void * thread_cbarg
Definition: evhtp/evhtp.h:322
evhtp::evbase
struct event_base * evbase
the initialized event_base
Definition: evhtp/evhtp.h:285
evhtp::thr_pool
evthr_pool_t * thr_pool
connection threadpool
Definition: evhtp/evhtp.h:312
evhtp::send_timeo
struct timeval send_timeo
Definition: evhtp/evhtp.h:328
evhtp::parser_flags
uint16_t parser_flags
default query flags to alter 'strictness' (see EVHTP_PARSE_QUERY_FLAG_*)
Definition: evhtp/evhtp.h:304
evhtp::thread_init_cb
evhtp_thread_init_cb thread_init_cb
Definition: evhtp/evhtp.h:315
evhtp::bev_flags
int bev_flags
bufferevent flags to use on bufferevent_*_socket_new()
Definition: evhtp/evhtp.h:289
evhtp::recv_timeo
struct timeval recv_timeo
Definition: evhtp/evhtp.h:327
evhtp::lock
pthread_mutex_t * lock
parent lock for add/del cbs in threads
Definition: evhtp/evhtp.h:313
evhtp::server
struct evconnlistener * server
the libevent listener struct
Definition: evhtp/evhtp.h:286
evhtp::TAILQ_HEAD
TAILQ_HEAD(, evhtp_alias) aliases
evhtp::ssl_cfg
evhtp_ssl_cfg_t * ssl_cfg
Definition: evhtp/evhtp.h:308
evhtp::arg
void * arg
user-defined evhtp_t specific arguments
Definition: evhtp/evhtp.h:288
evhtp::TAILQ_ENTRY
TAILQ_ENTRY(evhtp) next_vhost
evhtp::parent
evhtp_t * parent
only when this is a vhost
Definition: evhtp/evhtp.h:284
evhtp::flags
uint16_t flags
the base flags set for this context, see: EVHTP_FLAG_*
Definition: evhtp/evhtp.h:303
evhtp::ssl_ctx
evhtp_ssl_ctx_t * ssl_ctx
if ssl enabled, this is the servers CTX
Definition: evhtp/evhtp.h:307
evhtp::max_keepalive_requests
uint64_t max_keepalive_requests
Definition: evhtp/evhtp.h:291
evhtp::max_body_size
uint64_t max_body_size
Definition: evhtp/evhtp.h:290
evhtp::callbacks
evhtp_callbacks_t * callbacks
Definition: evhtp/evhtp.h:324
evhtp::defaults
evhtp_defaults_t defaults
Definition: evhtp/evhtp.h:325
htparser
Definition: parser.c:91
cb
evthr_cb cb
Definition: thread.c:2