Libevhtp  0.3.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
evhtp.h
Go to the documentation of this file.
1 #ifndef __EVHTP__H__
2 #define __EVHTP__H__
3 
4 #include <evhtp-config.h>
5 
6 #ifndef EVHTP_EXPORT
7 # if (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER || defined __clang__
8 # define EVHTP_EXPORT __attribute__ ((visibility("default")))
9 # else
10 # define EVHTP_EXPORT
11 # endif
12 #endif
13 
14 #ifndef EVHTP_DISABLE_EVTHR
15 #include <evthr.h>
16 #endif
17 
18 #include <htparse.h>
19 
20 #ifndef EVHTP_DISABLE_REGEX
21 #include <onigposix.h>
22 #endif
23 
24 #include <sys/queue.h>
25 #include <event2/event.h>
26 #include <event2/listener.h>
27 #include <event2/buffer.h>
28 #include <event2/bufferevent.h>
29 
30 #ifndef EVHTP_DISABLE_SSL
31 #include <event2/bufferevent_ssl.h>
32 #include <openssl/ssl.h>
33 #include <openssl/err.h>
34 #include <openssl/rand.h>
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #ifndef EVHTP_DISABLE_SSL
42 typedef SSL_SESSION evhtp_ssl_sess_t;
43 typedef SSL evhtp_ssl_t;
44 typedef SSL_CTX evhtp_ssl_ctx_t;
45 typedef X509 evhtp_x509_t;
46 typedef X509_STORE_CTX evhtp_x509_store_ctx_t;
47 #else
48 typedef void evhtp_ssl_sess_t;
49 typedef void evhtp_ssl_t;
50 typedef void evhtp_ssl_ctx_t;
51 typedef void evhtp_x509_t;
52 typedef void evhtp_x509_store_ctx_t;
53 #endif
54 
55 typedef struct evbuffer evbuf_t;
56 typedef struct event event_t;
57 typedef struct evconnlistener evserv_t;
58 typedef struct bufferevent evbev_t;
59 
60 #ifdef EVHTP_DISABLE_EVTHR
61 typedef struct event_base evbase_t;
62 typedef void evthr_t;
63 typedef void evthr_pool_t;
64 typedef void evhtp_mutex_t;
65 #else
66 typedef pthread_mutex_t evhtp_mutex_t;
67 #endif
68 
69 typedef struct evhtp_s evhtp_t;
71 typedef struct evhtp_callbacks_s evhtp_callbacks_t;
74 typedef struct evhtp_kv_s evhtp_kv_t;
75 typedef struct evhtp_kvs_s evhtp_kvs_t;
76 typedef struct evhtp_uri_s evhtp_uri_t;
77 typedef struct evhtp_path_s evhtp_path_t;
84 typedef uint16_t evhtp_res;
85 typedef uint8_t evhtp_error_flags;
86 
87 
88 #define evhtp_header_s evhtp_kv_s
89 #define evhtp_headers_s evhtp_kvs_s
90 #define evhtp_query_s evhtp_kvs_s
91 
92 #define evhtp_header_t evhtp_kv_t
93 #define evhtp_headers_t evhtp_kvs_t
94 #define evhtp_query_t evhtp_kvs_t
95 
101 };
102 
123 };
124 
128 #ifndef EVHTP_DISABLE_REGEX
130 #endif
131 };
132 
137 };
138 
142 };
143 
148 typedef enum evhtp_type evhtp_type;
149 
150 typedef void (* evhtp_thread_init_cb)(evhtp_t * htp, evthr_t * thr, void * arg);
151 typedef void (* evhtp_callback_cb)(evhtp_request_t * req, void * arg);
152 typedef void (* evhtp_hook_err_cb)(evhtp_request_t * req, evhtp_error_flags errtype, void * arg);
153 typedef void (* evhtp_hook_event_cb)(evhtp_connection_t * conn, short events, void * arg);
154 
155 /* Generic hook for passing ISO tests */
156 typedef evhtp_res (* evhtp_hook)();
157 
158 typedef evhtp_res (* evhtp_hook_conn_err_cb)(evhtp_connection_t * connection, evhtp_error_flags errtype, void * arg);
159 typedef evhtp_res (* evhtp_pre_accept_cb)(evhtp_connection_t * conn, void * arg);
160 typedef evhtp_res (* evhtp_post_accept_cb)(evhtp_connection_t * conn, void * arg);
161 typedef evhtp_res (* evhtp_hook_header_cb)(evhtp_request_t * req, evhtp_header_t * hdr, void * arg);
162 typedef evhtp_res (* evhtp_hook_headers_cb)(evhtp_request_t * req, evhtp_headers_t * hdr, void * arg);
163 typedef evhtp_res (* evhtp_hook_path_cb)(evhtp_request_t * req, evhtp_path_t * path, void * arg);
164 typedef evhtp_res (* evhtp_hook_read_cb)(evhtp_request_t * req, evbuf_t * buf, void * arg);
165 typedef evhtp_res (* evhtp_hook_request_fini_cb)(evhtp_request_t * req, void * arg);
166 typedef evhtp_res (* evhtp_hook_connection_fini_cb)(evhtp_connection_t * connection, void * arg);
167 typedef evhtp_res (* evhtp_hook_chunk_new_cb)(evhtp_request_t * r, uint64_t len, void * arg);
171 typedef evhtp_res (* evhtp_hook_hostname_cb)(evhtp_request_t * r, const char * hostname, void * arg);
172 typedef evhtp_res (* evhtp_hook_write_cb)(evhtp_connection_t * conn, void * arg);
173 
174 typedef int (* evhtp_kvs_iterator)(evhtp_kv_t * kv, void * arg);
175 typedef int (* evhtp_headers_iterator)(evhtp_header_t * header, void * arg);
176 
177 #ifndef EVHTP_DISABLE_SSL
178 typedef int (* evhtp_ssl_verify_cb)(int pre_verify, evhtp_x509_store_ctx_t * ctx);
179 typedef int (* evhtp_ssl_chk_issued_cb)(evhtp_x509_store_ctx_t * ctx, evhtp_x509_t * x, evhtp_x509_t * issuer);
180 
181 typedef int (* evhtp_ssl_scache_add)(evhtp_connection_t * connection, unsigned char * sid, int sid_len, evhtp_ssl_sess_t * sess);
182 typedef void (* evhtp_ssl_scache_del)(evhtp_t * htp, unsigned char * sid, int sid_len);
183 typedef evhtp_ssl_sess_t * (* evhtp_ssl_scache_get)(evhtp_connection_t * connection, unsigned char * sid, int sid_len);
184 typedef void * (* evhtp_ssl_scache_init)(evhtp_t *);
185 #endif
186 
187 #define EVHTP_VERSION "1.2.10"
188 #define EVHTP_VERSION_MAJOR 1
189 #define EVHTP_VERSION_MINOR 2
190 #define EVHTP_VERSION_PATCH 10
191 
192 #define evhtp_headers_iterator evhtp_kvs_iterator
193 
194 #define EVHTP_RES_ERROR 0
195 #define EVHTP_RES_PAUSE 1
196 #define EVHTP_RES_FATAL 2
197 #define EVHTP_RES_USER 3
198 #define EVHTP_RES_DATA_TOO_LONG 4
199 #define EVHTP_RES_OK 200
200 
201 #define EVHTP_RES_100 100
202 #define EVHTP_RES_CONTINUE 100
203 #define EVHTP_RES_SWITCH_PROTO 101
204 #define EVHTP_RES_PROCESSING 102
205 #define EVHTP_RES_URI_TOOLONG 122
206 
207 #define EVHTP_RES_200 200
208 #define EVHTP_RES_CREATED 201
209 #define EVHTP_RES_ACCEPTED 202
210 #define EVHTP_RES_NAUTHINFO 203
211 #define EVHTP_RES_NOCONTENT 204
212 #define EVHTP_RES_RSTCONTENT 205
213 #define EVHTP_RES_PARTIAL 206
214 #define EVHTP_RES_MSTATUS 207
215 #define EVHTP_RES_IMUSED 226
216 
217 #define EVHTP_RES_300 300
218 #define EVHTP_RES_MCHOICE 300
219 #define EVHTP_RES_MOVEDPERM 301
220 #define EVHTP_RES_FOUND 302
221 #define EVHTP_RES_SEEOTHER 303
222 #define EVHTP_RES_NOTMOD 304
223 #define EVHTP_RES_USEPROXY 305
224 #define EVHTP_RES_SWITCHPROXY 306
225 #define EVHTP_RES_TMPREDIR 307
226 
227 #define EVHTP_RES_400 400
228 #define EVHTP_RES_BADREQ 400
229 #define EVHTP_RES_UNAUTH 401
230 #define EVHTP_RES_PAYREQ 402
231 #define EVHTP_RES_FORBIDDEN 403
232 #define EVHTP_RES_NOTFOUND 404
233 #define EVHTP_RES_METHNALLOWED 405
234 #define EVHTP_RES_NACCEPTABLE 406
235 #define EVHTP_RES_PROXYAUTHREQ 407
236 #define EVHTP_RES_TIMEOUT 408
237 #define EVHTP_RES_CONFLICT 409
238 #define EVHTP_RES_GONE 410
239 #define EVHTP_RES_LENREQ 411
240 #define EVHTP_RES_PRECONDFAIL 412
241 #define EVHTP_RES_ENTOOLARGE 413
242 #define EVHTP_RES_URITOOLARGE 414
243 #define EVHTP_RES_UNSUPPORTED 415
244 #define EVHTP_RES_RANGENOTSC 416
245 #define EVHTP_RES_EXPECTFAIL 417
246 #define EVHTP_RES_IAMATEAPOT 418
247 
248 #define EVHTP_RES_500 500
249 #define EVHTP_RES_SERVERR 500
250 #define EVHTP_RES_NOTIMPL 501
251 #define EVHTP_RES_BADGATEWAY 502
252 #define EVHTP_RES_SERVUNAVAIL 503
253 #define EVHTP_RES_GWTIMEOUT 504
254 #define EVHTP_RES_VERNSUPPORT 505
255 #define EVHTP_RES_BWEXEED 509
256 
261  void * cbarg;
264 };
265 
267  char * alias;
268 
270 };
271 
275 struct evhtp_s {
277  evbase_t * evbase;
279  char * server_name;
280  void * arg;
281  int bev_flags;
282  uint64_t max_body_size;
287 #ifndef EVHTP_DISABLE_SSL
288  evhtp_ssl_ctx_t * ssl_ctx;
290 #endif
291 
292 #ifndef EVHTP_DISABLE_EVTHR
293  evthr_pool_t * thr_pool;
294 #endif
295 
296 #ifndef EVHTP_DISABLE_EVTHR
297  pthread_mutex_t * lock;
300 #endif
303 
304  struct timeval recv_timeo;
305  struct timeval send_timeo;
306 
307  TAILQ_HEAD(, evhtp_alias_s) aliases;
308  TAILQ_HEAD(, evhtp_s) vhosts;
309  TAILQ_ENTRY(evhtp_s) next_vhost;
310 };
311 
327  evhtp_callback_type type;
329  unsigned int hash;
330  void * cbarg;
333  union {
334  char * path;
335  char * glob;
336 #ifndef EVHTP_DISABLE_REGEX
337  regex_t * regex;
338 #endif
339  } val;
340 
341  TAILQ_ENTRY(evhtp_callback_s) next;
342 };
343 
344 TAILQ_HEAD(evhtp_callbacks_s, evhtp_callback_s);
345 
349 struct evhtp_kv_s {
350  char * key;
351  char * val;
352 
353  size_t klen;
354  size_t vlen;
355 
356  char k_heaped;
357  char v_heaped;
359  TAILQ_ENTRY(evhtp_kv_s) next;
360 };
361 
362 TAILQ_HEAD(evhtp_kvs_s, evhtp_kv_s);
363 
364 
365 
369 struct evhtp_uri_s {
372  unsigned char * fragment;
373  unsigned char * query_raw;
375  htp_scheme scheme;
376 };
377 
378 
383  char * username;
384  char * password;
385  char * hostname;
386  uint16_t port;
387 };
388 
389 
393 struct evhtp_path_s {
394  char * full;
395  char * path;
396  char * file;
397  char * match_start;
398  char * match_end;
399  unsigned int matched_soff;
402  unsigned int matched_eoff;
405 };
406 
407 
420  evhtp_proto proto;
421  htp_method method;
422  evhtp_res status;
423  uint8_t keepalive : 1,
424  finished : 1,
425  chunked : 1,
426  error : 1,
427  pad : 4;
430  void * cbarg;
433 };
434 
435 #define evhtp_request_content_len(r) htparser_get_content_length(r->conn->parser)
436 
439  evbase_t * evbase;
441  evthr_t * thread;
442 #ifndef EVHTP_DISABLE_SSL
443  evhtp_ssl_t * ssl;
444 #endif
446  htparser * parser;
448  struct sockaddr * saddr;
449  struct timeval recv_timeo;
450  struct timeval send_timeo;
451  evutil_socket_t sock;
453  uint64_t max_body_size;
454  uint64_t body_bytes_read;
455  uint64_t num_requests;
456  evhtp_type type;
457  uint8_t error : 1,
458  owner : 1,
459  vhost_via_sni : 1,
460  paused : 1,
461  connected : 1,
462  waiting : 1,
463  free_connection : 1,
464  keepalive : 1;
465  struct ev_token_bucket_cfg * ratelimit_cfg;
467 #ifdef EVHTP_FUTURE_USE
468  TAILQ_HEAD(, evhtp_request_s) pending;
469 #endif
470 };
471 
488 
492  void * on_path_arg;
493  void * on_read_arg;
497  void * on_error_arg;
502  void * on_write_arg;
503  void * on_event_arg;
504 };
505 
506 #ifndef EVHTP_DISABLE_SSL
508  char * pemfile;
509  char * privfile;
510  char * cafile;
511  char * capath;
512  char * ciphers;
513  char * named_curve;
514  char * dhparams;
515  long ssl_opts;
522  evhtp_ssl_scache_type scache_type;
529  void * args;
530 };
531 #endif
532 
541 EVHTP_EXPORT evhtp_t * evhtp_new(evbase_t * evbase, void * arg);
542 EVHTP_EXPORT void evhtp_free(evhtp_t * evhtp);
543 
544 
554 EVHTP_EXPORT void evhtp_set_timeouts(evhtp_t * htp, const struct timeval * r, const struct timeval * w);
555 
556 
570 EVHTP_EXPORT void evhtp_set_parser_flags(evhtp_t * htp, int flags);
571 
578 EVHTP_EXPORT void evhtp_set_bev_flags(evhtp_t * htp, int flags);
579 
580 #ifndef EVHTP_DISABLE_SSL
582 EVHTP_EXPORT int evhtp_ssl_init(evhtp_t * htp, evhtp_ssl_cfg_t * ssl_cfg);
583 #endif
584 
585 
593 
603 
611 EVHTP_EXPORT void evhtp_set_gencb(evhtp_t * htp, evhtp_callback_cb cb, void * arg);
614 
625 EVHTP_EXPORT evhtp_callback_t * evhtp_set_cb(evhtp_t * htp, const char * path,
626  evhtp_callback_cb cb, void * arg);
627 
628 
629 
640 #ifndef EVHTP_DISABLE_REGEX
641 EVHTP_EXPORT evhtp_callback_t * evhtp_set_regex_cb(evhtp_t * htp, const char * pattern,
642  evhtp_callback_cb cb, void * arg);
643 #endif
644 
645 
646 
659 EVHTP_EXPORT evhtp_callback_t * evhtp_set_glob_cb(evhtp_t * htp, const char * pattern,
660  evhtp_callback_cb cb, void * arg);
661 
701 EVHTP_EXPORT int evhtp_set_hook(evhtp_hooks_t ** hooks, evhtp_hook_type type,
702  evhtp_hook cb, void * arg);
703 
704 
713 EVHTP_EXPORT int evhtp_unset_hook(evhtp_hooks_t ** hooks, evhtp_hook_type type);
714 
715 
724 
740 EVHTP_EXPORT int evhtp_bind_socket(evhtp_t * htp, const char * addr, uint16_t port, int backlog);
741 
742 
749 
760 EVHTP_EXPORT int evhtp_bind_sockaddr(evhtp_t * htp, struct sockaddr *,
761  size_t sin_len, int backlog);
762 
763 
777 EVHTP_EXPORT int evhtp_use_threads(evhtp_t * htp, evhtp_thread_init_cb init_cb, int nthreads, void * arg);
778 
779 
786 EVHTP_EXPORT void evhtp_send_reply(evhtp_request_t * request, evhtp_res code);
787 
788 
789 /* The following three functions allow for the user to do what evhtp_send_reply does at its core
790  * but for the weak of heart.
791  */
792 EVHTP_EXPORT void evhtp_send_reply_start(evhtp_request_t * request, evhtp_res code);
795 
802 EVHTP_EXPORT int evhtp_response_needs_body(const evhtp_res code, const htp_method method);
803 
811 EVHTP_EXPORT void evhtp_send_reply_chunk_start(evhtp_request_t * request, evhtp_res code);
812 
813 
821 
829 
850 evhtp_callback_new(const char * path, evhtp_callback_type type, evhtp_callback_cb cb, void * arg);
851 
852 
859 
860 
870 
871 
884 EVHTP_EXPORT int evhtp_add_vhost(evhtp_t * evhtp, const char * name, evhtp_t * vhost);
885 
886 
897 EVHTP_EXPORT int evhtp_add_alias(evhtp_t * evhtp, const char * name);
898 
909 EVHTP_EXPORT evhtp_kv_t * evhtp_kv_new(const char * key, const char * val, char kalloc, char valloc);
910 
911 
918 
919 
926 
927 
934 
935 
943 
944 
953 EVHTP_EXPORT const char * evhtp_kv_find(evhtp_kvs_t * kvs, const char * key);
954 
955 
964 EVHTP_EXPORT evhtp_kv_t * evhtp_kvs_find_kv(evhtp_kvs_t * kvs, const char * key);
965 
966 
974 
982 
983 
994 
995 #define EVHTP_PARSE_QUERY_FLAG_STRICT 0
996 #define EVHTP_PARSE_QUERY_FLAG_IGNORE_HEX (1 << 0)
997 #define EVHTP_PARSE_QUERY_FLAG_ALLOW_EMPTY_VALS (1 << 1)
998 #define EVHTP_PARSE_QUERY_FLAG_ALLOW_NULL_VALS (1 << 2)
999 #define EVHTP_PARSE_QUERY_FLAG_TREAT_SEMICOLON_AS_SEP (1 << 3)
1000 #define EVHTP_PARSE_QUERY_FLAG_IGNORE_FRAGMENTS (1 << 4)
1001 #define EVHTP_PARSE_QUERY_FLAG_LENIENT \
1002  EVHTP_PARSE_QUERY_FLAG_IGNORE_HEX \
1003  | EVHTP_PARSE_QUERY_FLAG_ALLOW_EMPTY_VALS \
1004  | EVHTP_PARSE_QUERY_FLAG_ALLOW_NULL_VALS \
1005  | EVHTP_PARSE_QUERY_FLAG_TREAT_SEMICOLON_AS_SEP
1006 
1018 EVHTP_EXPORT evhtp_query_t * evhtp_parse_query_wflags(const char * query, size_t len, int flags);
1019 
1031 EVHTP_EXPORT evhtp_query_t * evhtp_parse_query(const char * query, size_t len);
1032 
1042 EVHTP_EXPORT int evhtp_unescape_string(unsigned char ** out, unsigned char * str, size_t str_len);
1043 
1054 EVHTP_EXPORT evhtp_header_t * evhtp_header_new(const char * key, const char * val,
1055  char kalloc, char valloc);
1056 
1068  const char * key, char kalloc);
1069 
1070 
1081  const char * val, char valloc);
1082 
1083 
1091 
1100 EVHTP_EXPORT const char * evhtp_header_find(evhtp_headers_t * headers, const char * key);
1101 
1102 #define evhtp_header_find evhtp_kv_find
1103 #define evhtp_headers_find_header evhtp_kvs_find_kv
1104 #define evhtp_headers_for_each evhtp_kvs_for_each
1105 #define evhtp_header_new evhtp_kv_new
1106 #define evhtp_header_free evhtp_kv_free
1107 #define evhtp_headers_new evhtp_kvs_new
1108 #define evhtp_headers_free evhtp_kvs_free
1109 #define evhtp_header_rm_and_free evhtp_kv_rm_and_free
1110 #define evhtp_headers_add_header evhtp_kvs_add_kv
1111 #define evhtp_headers_add_headers evhtp_kvs_add_kvs
1112 #define evhtp_query_new evhtp_kvs_new
1113 #define evhtp_query_free evhtp_kvs_free
1114 
1115 
1124 
1125 /* the following functions all do the same thing, pause and the processing */
1130 
1131 
1140 
1148 
1156 
1157 
1166 
1175 EVHTP_EXPORT void
1177  const struct timeval * r,
1178  const struct timeval * w);
1179 
1188 
1189 
1203 
1204 
1213 
1221 EVHTP_EXPORT void evhtp_set_max_body_size(evhtp_t * htp, uint64_t len);
1222 
1231 
1238 EVHTP_EXPORT void evhtp_request_set_max_body_size(evhtp_request_t * request, uint64_t len);
1239 
1246 EVHTP_EXPORT void evhtp_set_max_keepalive_requests(evhtp_t * htp, uint64_t num);
1247 
1248 
1262 EVHTP_EXPORT int
1264  size_t read_rate, size_t read_burst,
1265  size_t write_rate,
1266  size_t write_burst,
1267  const struct timeval * tick);
1268 
1269 /*****************************************************************
1270 * client request functions *
1271 *****************************************************************/
1272 
1277 evhtp_connection_new_dns(evbase_t * evbase,
1278  struct evdns_base * dns_base,
1279  const char * addr, uint16_t port);
1280 
1285 evhtp_connection_new(evbase_t * evbase, const char * addr, uint16_t port);
1286 
1287 #ifndef DISABLE_SSL
1288 evhtp_connection_t * evhtp_connection_ssl_new(evbase_t * evbase, const char * addr, uint16_t port, evhtp_ssl_ctx_t * ctx);
1289 #endif
1290 
1291 
1296 
1301  evhtp_request_t * r, htp_method meth, const char * uri);
1302 
1304 
1305 #ifdef __cplusplus
1306 }
1307 #endif
1308 
1309 #endif /* __EVHTP__H__ */
char * key
Definition: evhtp.h:350
evhtp_callbacks_t * callbacks
Definition: evhtp.h:301
uint16_t evhtp_res
Definition: evhtp.h:84
EVHTP_EXPORT void evhtp_connection_resume(evhtp_connection_t *connection)
resumes a connection (enables reading) and activates resume event.
Definition: evhtp.c:2352
void * on_new_chunk_arg
Definition: evhtp.h:498
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:2509
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. This will add the last 0CRLFC...
Definition: evhtp.c:3138
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:2602
evhtp_ssl_scache_init scache_init
Definition: evhtp.h:525
evhtp_proto proto
Definition: evhtp.h:420
evhtp_hook_request_fini_cb on_request_fini
Definition: evhtp.h:478
long store_flags
Definition: evhtp.h:521
evhtp_hook_header_cb on_header
Definition: evhtp.h:474
evhtp_ssl_scache_del scache_del
Definition: evhtp.h:528
void * on_connection_fini_arg
Definition: evhtp.h:495
EVHTP_EXPORT int evhtp_unset_all_hooks(evhtp_hooks_t **hooks)
removes all hooks.
Definition: evhtp.c:3433
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:3899
evhtp_ssl_chk_issued_cb x509_chk_issued_cb
Definition: evhtp.h:520
evbase_t * evbase
Definition: evhtp.h:439
void * on_headers_start_arg
Definition: evhtp.h:489
struct evbuffer evbuf_t
Definition: evhtp.h:55
EVHTP_EXPORT unsigned int evhtp_request_status(evhtp_request_t *)
Definition: evhtp.c:4330
char * alias
Definition: evhtp.h:267
EVHTP_EXPORT void evhtp_request_free(evhtp_request_t *request)
Definition: evhtp.c:3964
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:3617
unsigned char * query_raw
Definition: evhtp.h:373
evhtp_ssl_t * ssl
Definition: evhtp.h:443
void * on_header_arg
Definition: evhtp.h:490
char * privfile
Definition: evhtp.h:509
evhtp_thread_init_cb thread_init_cb
Definition: evhtp.h:298
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:2439
evhtp_ssl_verify_cb x509_verify_cb
Definition: evhtp.h:519
void * on_read_arg
Definition: evhtp.h:493
char * glob
Definition: evhtp.h:335
evbase_t * evbase
Definition: evhtp.h:277
void * on_connection_error_arg
Definition: evhtp.h:496
void * cbarg
Definition: evhtp.h:261
EVHTP_EXPORT 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 ...
Definition: evhtp.c:3045
evhtp_hook_write_cb on_write
Definition: evhtp.h:486
char * path
Definition: evhtp.h:334
evhtp_hook_path_cb on_path
Definition: evhtp.h:476
evhtp_ssl_cfg_t * ssl_cfg
Definition: evhtp.h:289
EVHTP_EXPORT int evhtp_ssl_use_threads(void)
Definition: evhtp.c:3671
unsigned char * fragment
Definition: evhtp.h:372
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:3565
int parser_flags
Definition: evhtp.h:285
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:3894
evhtp_defaults_t defaults
Definition: evhtp.h:302
evbuf_t * buffer_out
Definition: evhtp.h:417
regex_t * regex
Definition: evhtp.h:337
void * thread_init_cbarg
Definition: evhtp.h:299
EVHTP_EXPORT evbev_t * evhtp_connection_get_bev(evhtp_connection_t *conn)
returns the underlying connections bufferevent
Definition: evhtp.c:3847
evhtp_hook_chunk_new_cb on_new_chunk
Definition: evhtp.h:482
char k_heaped
Definition: evhtp.h:356
uint64_t max_body_size
Definition: evhtp.h:282
evhtp_connection_t * evhtp_connection_ssl_new(evbase_t *evbase, const char *addr, uint16_t port, evhtp_ssl_ctx_t *ctx)
Definition: evhtp.c:4250
evhtp_res(* evhtp_hook_headers_start_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp.h:170
evhtp_res(* evhtp_hook_chunk_fini_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp.h:168
main structure containing all configuration information
Definition: evhtp.h:275
SSL evhtp_ssl_t
Definition: evhtp.h:43
evhtp_callback_cb cb
Definition: evhtp.h:429
char * hostname
Definition: evhtp.h:385
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:2735
void * on_request_fini_arg
Definition: evhtp.h:494
#define evhtp_headers_iterator
Definition: evhtp.h:192
EVHTP_EXPORT void evhtp_unbind_socket(evhtp_t *htp)
stops the listening socket.
Definition: evhtp.c:3148
uint64_t num_requests
Definition: evhtp.h:455
void * args
Definition: evhtp.h:529
#define evhtp_headers_t
Definition: evhtp.h:93
EVHTP_EXPORT void evhtp_connection_set_bev(evhtp_connection_t *conn, evbev_t *bev)
Sets the connections underlying bufferevent.
Definition: evhtp.c:3884
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:3344
int(* evhtp_ssl_chk_issued_cb)(evhtp_x509_store_ctx_t *ctx, evhtp_x509_t *x, evhtp_x509_t *issuer)
Definition: evhtp.h:179
evhtp_request_t * request
Definition: evhtp.h:452
void * on_error_arg
Definition: evhtp.h:497
EVHTP_EXPORT void evhtp_kvs_free(evhtp_kvs_t *kvs)
frees a the list of key/values, and all underlying entries
Definition: evhtp.c:2520
evhtp_res(* evhtp_hook_write_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp.h:172
void * on_headers_arg
Definition: evhtp.h:491
struct evhtp_callbacks_s evhtp_callbacks_t
Definition: evhtp.h:71
uint64_t body_bytes_read
Definition: evhtp.h:454
char * path
Definition: evhtp.h:395
SSL_SESSION evhtp_ssl_sess_t
Definition: evhtp.h:42
evhtp_headers_t * headers_in
Definition: evhtp.h:418
void * on_event_arg
Definition: evhtp.h:503
evhtp_callback_cb cb
Definition: evhtp.h:328
evhtp_ssl_scache_type scache_type
Definition: evhtp.h:522
SSL_CTX evhtp_ssl_ctx_t
Definition: evhtp.h:44
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. The addr can be defined as on...
Definition: evhtp.c:3196
struct ev_token_bucket_cfg * ratelimit_cfg
Definition: evhtp.h:465
void(* evhtp_hook_err_cb)(evhtp_request_t *req, evhtp_error_flags errtype, void *arg)
Definition: evhtp.h:152
evhtp_hook_read_cb on_read
Definition: evhtp.h:477
char * password
Definition: evhtp.h:384
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:3926
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:2559
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:2576
evutil_socket_t sock
Definition: evhtp.h:451
#define evhtp_header_find
Definition: evhtp.h:1102
struct evhtp_kvs_s evhtp_kvs_t
Definition: evhtp.h:75
long scache_timeout
Definition: evhtp.h:523
evhtp_ssl_scache_type
Definition: evhtp.h:96
uint8_t evhtp_error_flags
Definition: evhtp.h:85
X509_STORE_CTX evhtp_x509_store_ctx_t
Definition: evhtp.h:46
EVHTP_EXPORT void evhtp_send_reply_end(evhtp_request_t *request)
Definition: evhtp.c:3014
EVHTP_EXPORT void evhtp_request_set_bev(evhtp_request_t *request, evbev_t *bev)
sets the underlying bufferevent for a evhtp_request
Definition: evhtp.c:3889
evhtp_t * parent
Definition: evhtp.h:276
evhtp_headers_t * headers_out
Definition: evhtp.h:419
void * pre_accept_cbarg
Definition: evhtp.h:262
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:2983
uint16_t port
Definition: evhtp.h:386
long ssl_ctx_timeout
Definition: evhtp.h:516
evhtp_res(* evhtp_pre_accept_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp.h:159
a generic key/value structure
Definition: evhtp.h:349
a structure containing all information for a http request.
Definition: evhtp.h:411
evhtp_callback_cb cb
Definition: evhtp.h:258
htp_scheme scheme
Definition: evhtp.h:375
evhtp_res(* evhtp_hook_chunk_new_cb)(evhtp_request_t *r, uint64_t len, void *arg)
Definition: evhtp.h:167
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:4006
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_new_dns(evbase_t *evbase, struct evdns_base *dns_base, const char *addr, uint16_t port)
allocate a new connection
Definition: evhtp.c:4183
int verify_depth
Definition: evhtp.h:518
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:3996
uint64_t max_body_size
Definition: evhtp.h:453
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:3651
struct sockaddr * saddr
Definition: evhtp.h:448
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:2399
evhtp_res(* evhtp_post_accept_cb)(evhtp_connection_t *conn, void *arg)
Definition: evhtp.h:160
evhtp_hook_type
types associated with where a developer can hook into during the request processing cycle...
Definition: evhtp.h:107
htparser * parser
Definition: evhtp.h:446
void * on_path_arg
Definition: evhtp.h:492
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:3581
evhtp_pre_accept_cb pre_accept
Definition: evhtp.h:259
evhtp_res(* evhtp_hook_read_cb)(evhtp_request_t *req, evbuf_t *buf, void *arg)
Definition: evhtp.h:164
evhtp_res(* evhtp_hook_request_fini_cb)(evhtp_request_t *req, void *arg)
Definition: evhtp.h:165
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:2328
evhtp_hook_headers_cb on_headers
Definition: evhtp.h:475
structure containing a single callback and configuration
Definition: evhtp.h:326
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:3154
TAILQ_ENTRY(evhtp_alias_s) next
evhtp_proto
Definition: evhtp.h:133
void * cbarg
Definition: evhtp.h:330
EVHTP_EXPORT int evhtp_use_threads(evhtp_t *htp, evhtp_thread_init_cb init_cb, int nthreads, void *arg)
Enable thread-pool support for an evhtp_t context. Connectios are distributed across 'nthreads'...
Definition: evhtp.c:3544
char * cafile
Definition: evhtp.h:510
evhtp_hook_conn_err_cb on_connection_error
Definition: evhtp.h:480
long scache_size
Definition: evhtp.h:524
evhtp_type type
Definition: evhtp.h:456
size_t vlen
Definition: evhtp.h:354
EVHTP_EXPORT 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...
Definition: evhtp.c:3037
EVHTP_EXPORT void evhtp_send_reply_start(evhtp_request_t *request, evhtp_res code)
Definition: evhtp.c:2988
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:2593
EVHTP_EXPORT 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...
Definition: evhtp.c:3852
EVHTP_EXPORT int evhtp_connection_set_ratelimit(evhtp_connection_t *c, size_t read_rate, size_t read_burst, size_t write_rate, size_t write_burst, const struct timeval *tick)
set a bufferevent ratelimit on a evhtp_connection_t structure. The logic is the same as libevent's ra...
evhtp_post_accept_cb post_accept
Definition: evhtp.h:260
evthr_t * thread
Definition: evhtp.h:441
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. When the timeout expires your error hook will be call...
Definition: evhtp.c:3969
evhtp_query_t * query
Definition: evhtp.h:374
void(* evhtp_thread_init_cb)(evhtp_t *htp, evthr_t *thr, void *arg)
Definition: evhtp.h:150
evhtp_ssl_ctx_t * ssl_ctx
Definition: evhtp.h:288
EVHTP_EXPORT evhtp_connection_t * evhtp_connection_new(evbase_t *evbase, const char *addr, uint16_t port)
allocate a new connection
Definition: evhtp.c:4178
evhtp_path_t * path
Definition: evhtp.h:371
EVHTP_EXPORT int evhtp_unset_hook(evhtp_hooks_t **hooks, evhtp_hook_type type)
remove a specific hook from being called.
Definition: evhtp.c:3428
char * full
Definition: evhtp.h:394
evhtp_callback_type
Definition: evhtp.h:125
evhtp_type
Definition: evhtp.h:139
char * dhparams
Definition: evhtp.h:514
a generic container representing an entire URI strucutre
Definition: evhtp.h:369
evhtp_ssl_scache_get scache_get
Definition: evhtp.h:527
struct evconnlistener evserv_t
Definition: evhtp.h:57
EVHTP_EXPORT void evhtp_kv_free(evhtp_kv_t *kv)
frees resources allocated for a single key/value
Definition: evhtp.c:2492
int(* evhtp_ssl_verify_cb)(int pre_verify, evhtp_x509_store_ctx_t *ctx)
Definition: evhtp.h:178
event_t * resume_ev
Definition: evhtp.h:447
void(* evhtp_callback_cb)(evhtp_request_t *req, void *arg)
Definition: evhtp.h:151
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:3921
EVHTP_EXPORT void evhtp_callback_free(evhtp_callback_t *callback)
frees information associated with a ainflwx callback.
Definition: evhtp.c:3314
void * on_hostname_arg
Definition: evhtp.h:501
evhtp_res(* evhtp_hook_connection_fini_cb)(evhtp_connection_t *connection, void *arg)
Definition: evhtp.h:166
EVHTP_EXPORT void evhtp_send_reply_chunk(evhtp_request_t *request, evbuf_t *buf)
send a chunk reply.
Definition: evhtp.c:3114
EVHTP_EXPORT void evhtp_set_pre_accept_cb(evhtp_t *htp, evhtp_pre_accept_cb, void *arg)
Definition: evhtp.c:3657
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:3980
evhtp_hook_chunks_fini_cb on_chunks_fini
Definition: evhtp.h:484
void * post_accept_cbarg
Definition: evhtp.h:263
pthread_mutex_t * lock
Definition: evhtp.h:297
pthread_mutex_t evhtp_mutex_t
Definition: evhtp.h:66
evhtp_res(* evhtp_hook)()
Definition: evhtp.h:156
void * on_chunks_fini_arg
Definition: evhtp.h:500
evhtp_connection_t * conn
Definition: evhtp.h:413
TAILQ_HEAD(evhtp_callbacks_s, evhtp_callback_s)
int bev_flags
Definition: evhtp.h:281
void * arg
Definition: evhtp.h:280
struct bufferevent evbev_t
Definition: evhtp.h:58
EVHTP_EXPORT void evhtp_connection_pause(evhtp_connection_t *connection)
pauses a connection (disables reading)
Definition: evhtp.c:2338
void *(* evhtp_ssl_scache_init)(evhtp_t *)
Definition: evhtp.h:184
#define evhtp_header_new
Definition: evhtp.h:1105
#define evhtp_query_t
Definition: evhtp.h:94
evhtp_hook_connection_fini_cb on_connection_fini
Definition: evhtp.h:479
void(* evhtp_hook_event_cb)(evhtp_connection_t *conn, short events, void *arg)
Definition: evhtp.h:153
int(* evhtp_kvs_iterator)(evhtp_kv_t *kv, void *arg)
Definition: evhtp.h:174
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:2386
char * capath
Definition: evhtp.h:511
EVHTP_EXPORT evhtp_t * evhtp_new(evbase_t *evbase, void *arg)
creates a new evhtp_t instance
Definition: evhtp.c:4081
char * username
Definition: evhtp.h:383
evhtp_res(* evhtp_hook_conn_err_cb)(evhtp_connection_t *connection, evhtp_error_flags errtype, void *arg)
Definition: evhtp.h:158
EVHTP_EXPORT evhtp_request_t * evhtp_request_new(evhtp_callback_cb cb, void *arg)
allocate a new request
Definition: evhtp.c:4286
unsigned int hash
Definition: evhtp.h:329
EVHTP_EXPORT evbev_t * evhtp_request_get_bev(evhtp_request_t *request)
returns the underlying requests bufferevent
Definition: evhtp.c:3874
evhtp_hooks_t * hooks
Definition: evhtp.h:445
#define evhtp_header_t
Definition: evhtp.h:92
EVHTP_EXPORT 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 HTT...
Definition: evhtp.c:4001
unsigned int matched_soff
Definition: evhtp.h:399
evhtp_res(* evhtp_hook_chunks_fini_cb)(evhtp_request_t *r, void *arg)
Definition: evhtp.h:169
unsigned int matched_eoff
Definition: evhtp.h:402
char * file
Definition: evhtp.h:396
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:2660
evhtp_hook_err_cb on_error
Definition: evhtp.h:481
evhtp_callback_type type
Definition: evhtp.h:327
struct event event_t
Definition: evhtp.h:56
char * named_curve
Definition: evhtp.h:513
char * match_end
Definition: evhtp.h:398
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:3019
evhtp_uri_t * uri
Definition: evhtp.h:415
char * server_name
Definition: evhtp.h:279
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:4046
X509 evhtp_x509_t
Definition: evhtp.h:45
EVHTP_EXPORT void evhtp_set_bev_flags(evhtp_t *htp, int flags)
bufferevent flags which will be used for bev sockets.
Definition: evhtp.c:3991
EVHTP_EXPORT 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 .
Definition: evhtp.c:3351
evthr_pool_t * thr_pool
Definition: evhtp.h:293
EVHTP_EXPORT void evhtp_send_reply_body(evhtp_request_t *request, evbuf_t *buf)
Definition: evhtp.c:3005
char * val
Definition: evhtp.h:351
evhtp_hook_event_cb on_event
Definition: evhtp.h:487
void(* evhtp_ssl_scache_del)(evhtp_t *htp, unsigned char *sid, int sid_len)
Definition: evhtp.h:182
evserv_t * server
Definition: evhtp.h:278
evhtp_res(* evhtp_hook_headers_cb)(evhtp_request_t *req, evhtp_headers_t *hdr, void *arg)
Definition: evhtp.h:162
evhtp_t * htp
Definition: evhtp.h:438
evhtp_res(* evhtp_hook_path_cb)(evhtp_request_t *req, evhtp_path_t *path, void *arg)
Definition: evhtp.h:163
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:3500
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:3912
uint64_t max_keepalive_requests
Definition: evhtp.h:283
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:4301
EVHTP_EXPORT 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 virtua...
Definition: evhtp.c:4011
EVHTP_EXPORT evhtp_kvs_t * evhtp_kvs_new(void)
creates an empty list of key/values
Definition: evhtp.c:2430
evhtp_ssl_sess_t *(* evhtp_ssl_scache_get)(evhtp_connection_t *connection, unsigned char *sid, int sid_len)
Definition: evhtp.h:183
evhtp_hook_chunk_fini_cb on_chunk_fini
Definition: evhtp.h:483
EVHTP_EXPORT void evhtp_request_pause(evhtp_request_t *request)
Wrapper around evhtp_connection_pause.
Definition: evhtp.c:2368
evbev_t * bev
Definition: evhtp.h:440
evhtp_hooks_t * hooks
Definition: evhtp.h:331
size_t klen
Definition: evhtp.h:353
htp_method method
Definition: evhtp.h:421
evhtp_res(* evhtp_hook_header_cb)(evhtp_request_t *req, evhtp_header_t *hdr, void *arg)
Definition: evhtp.h:161
char * pemfile
Definition: evhtp.h:508
EVHTP_EXPORT int evhtp_ssl_init(evhtp_t *htp, evhtp_ssl_cfg_t *ssl_cfg)
Definition: evhtp.c:3696
evhtp_hook_hostname_cb on_hostname
Definition: evhtp.h:485
evbuf_t * buffer_in
Definition: evhtp.h:416
EVHTP_EXPORT void evhtp_set_post_accept_cb(evhtp_t *htp, evhtp_post_accept_cb, void *arg)
Definition: evhtp.c:3663
evhtp_hooks_t * hooks
Definition: evhtp.h:414
void * cbarg
Definition: evhtp.h:430
evhtp_ssl_scache_add scache_add
Definition: evhtp.h:526
char * ciphers
Definition: evhtp.h:512
void * on_write_arg
Definition: evhtp.h:502
evhtp_t * htp
Definition: evhtp.h:412
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:2540
structure which represents a URI path and or file
Definition: evhtp.h:393
char * match_start
Definition: evhtp.h:397
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:3273
evhtp_hook_headers_start_cb on_headers_start
Definition: evhtp.h:473
evhtp_res(* evhtp_hook_hostname_cb)(evhtp_request_t *r, const char *hostname, void *arg)
Definition: evhtp.h:171
#define evhtp_headers_add_header
Definition: evhtp.h:1110
EVHTP_EXPORT void evhtp_request_resume(evhtp_request_t *request)
Wrapper around evhtp_connection_resume.
Definition: evhtp.c:2381
int disable_100_cont
Definition: evhtp.h:284
char v_heaped
Definition: evhtp.h:357
int verify_peer
Definition: evhtp.h:517
#define EVHTP_EXPORT
Definition: evhtp.h:10
structure which represents authority information in a URI
Definition: evhtp.h:382
evhtp_res status
Definition: evhtp.h:422
void * on_chunk_fini_arg
Definition: evhtp.h:499
int(* evhtp_ssl_scache_add)(evhtp_connection_t *connection, unsigned char *sid, int sid_len, evhtp_ssl_sess_t *sess)
Definition: evhtp.h:181
evhtp_authority_t * authority
Definition: evhtp.h:370
long ssl_opts
Definition: evhtp.h:515
EVHTP_EXPORT void evhtp_free(evhtp_t *evhtp)
Definition: evhtp.c:4105