Home
last modified time | relevance | path

Searched refs:bev (Results 1 – 25 of 42) sorted by relevance

12

/external/libevent/
Dbufferevent_async.c80 struct bufferevent_private bev; member
93 evutil_offsetof(struct bufferevent_async, bev.bev),
104 upcast(struct bufferevent *bev) in upcast() argument
107 if (bev->be_ops != &bufferevent_ops_async) in upcast()
109 bev_a = EVUTIL_UPCAST(bev, struct bufferevent_async, bev.bev); in upcast()
118 EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev)); in upcast_connect()
127 EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev)); in upcast_read()
136 EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev)); in upcast_write()
143 struct bufferevent *bev = &beva->bev.bev; in bev_async_del_write() local
147 event_base_del_virtual_(bev->ev_base); in bev_async_del_write()
[all …]
Dbufferevent_ratelim.c114 bufferevent_update_buckets(struct bufferevent_private *bev) in bufferevent_update_buckets() argument
119 event_base_gettimeofday_cached(bev->bev.ev_base, &now); in bufferevent_update_buckets()
120 tick = ev_token_bucket_get_tick_(&now, bev->rate_limiting->cfg); in bufferevent_update_buckets()
121 if (tick != bev->rate_limiting->limit.last_updated) in bufferevent_update_buckets()
122 ev_token_bucket_update_(&bev->rate_limiting->limit, in bufferevent_update_buckets()
123 bev->rate_limiting->cfg, tick); in bufferevent_update_buckets()
198 bufferevent_get_rlim_max_(struct bufferevent_private *bev, int is_write) in bufferevent_get_rlim_max_() argument
201 ev_ssize_t max_so_far = is_write?bev->max_single_write:bev->max_single_read; in bufferevent_get_rlim_max_()
216 if (!bev->rate_limiting) in bufferevent_get_rlim_max_()
224 if (bev->rate_limiting->cfg) { in bufferevent_get_rlim_max_()
[all …]
Dbufferevent_openssl.c291 struct bufferevent_private bev; member
341 evutil_offsetof(struct bufferevent_openssl, bev.bev),
354 upcast(struct bufferevent *bev) in upcast() argument
357 if (bev->be_ops != &bufferevent_ops_openssl) in upcast()
359 bev_o = (void*)( ((char*)bev) - in upcast()
360 evutil_offsetof(struct bufferevent_openssl, bev.bev)); in upcast()
361 EVUTIL_ASSERT(bev_o->bev.bev.be_ops == &bufferevent_ops_openssl); in upcast()
389 struct bufferevent *bev = &bev_ssl->bev.bev; in start_reading() local
391 r = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); in start_reading()
393 r = bufferevent_add_event_(&bev->ev_write, in start_reading()
[all …]
Dbufferevent.c63 static void bufferevent_cancel_all_(struct bufferevent *bev);
70 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_suspend_read_()
82 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_unsuspend_read_()
94 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_suspend_write_()
106 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_unsuspend_write_()
137 struct bufferevent *bufev = &bufev_private->bev; in bufferevent_run_deferred_callbacks_locked()
170 struct bufferevent *bufev = &bufev_private->bev; in bufferevent_run_deferred_callbacks_unlocked()
214 (bevp)->bev.ev_base, \
216 bufferevent_incref_(&(bevp)->bev); \
225 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_run_readcb_()
[all …]
Dbufferevent_filter.c81 struct bufferevent_private bev; member
105 evutil_offsetof(struct bufferevent_filtered, bev.bev),
118 upcast(struct bufferevent *bev) in upcast() argument
121 if (bev->be_ops != &bufferevent_ops_filter) in upcast()
123 bev_f = (void*)( ((char*)bev) - in upcast()
124 evutil_offsetof(struct bufferevent_filtered, bev.bev)); in upcast()
125 EVUTIL_ASSERT(bev_f->bev.bev.be_ops == &bufferevent_ops_filter); in upcast()
129 #define downcast(bev_f) (&(bev_f)->bev.bev)
192 if (bufferevent_init_common_(&bufev_f->bev, underlying->ev_base, in bufferevent_filter_new()
229 be_filter_unlink(struct bufferevent *bev) in be_filter_unlink() argument
[all …]
Dbufferevent_pair.c46 struct bufferevent_private bev; member
56 upcast(struct bufferevent *bev) in upcast() argument
59 if (bev->be_ops != &bufferevent_ops_pair) in upcast()
61 bev_p = EVUTIL_UPCAST(bev, struct bufferevent_pair, bev.bev); in upcast()
62 EVUTIL_ASSERT(bev_p->bev.bev.be_ops == &bufferevent_ops_pair); in upcast()
66 #define downcast(bev_pair) (&(bev_pair)->bev.bev)
99 if (bufferevent_init_common_(&bufev->bev, base, &bufferevent_ops_pair, in bufferevent_pair_elt_new()
104 if (!evbuffer_add_cb(bufev->bev.bev.output, be_pair_outbuf_cb, bufev)) { in bufferevent_pair_elt_new()
109 bufferevent_init_generic_timeout_cbs_(&bufev->bev.bev); in bufferevent_pair_elt_new()
135 bufferevent_enable_locking_(downcast(bufev2), bufev1->bev.lock); in bufferevent_pair_new()
[all …]
Dbufferevent_sock.c89 evutil_offsetof(struct bufferevent_private, bev),
100 bufferevent_socket_get_conn_address_(struct bufferevent *bev) in bufferevent_socket_get_conn_address_() argument
103 EVUTIL_UPCAST(bev, struct bufferevent_private, bev); in bufferevent_socket_get_conn_address_()
131 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_socket_outbuf_cb()
150 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_readcb()
232 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_writecb()
362 bufev = &bufev_p->bev; in bufferevent_socket_new()
379 bufferevent_socket_connect(struct bufferevent *bev, in bufferevent_socket_connect() argument
383 EVUTIL_UPCAST(bev, struct bufferevent_private, bev); in bufferevent_socket_connect()
390 bufferevent_incref_and_lock_(bev); in bufferevent_socket_connect()
[all …]
Dbufferevent-internal.h156 struct bufferevent bev; member
411 void bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev);
416 int bufferevent_generic_adj_timeouts_(struct bufferevent *bev);
417 int bufferevent_generic_adj_existing_timeouts_(struct bufferevent *bev);
419 enum bufferevent_options bufferevent_get_options_(struct bufferevent *bev);
422 bufferevent_socket_get_conn_address_(struct bufferevent *bev);
426 #define BEV_RESET_GENERIC_READ_TIMEOUT(bev) \ argument
428 if (evutil_timerisset(&(bev)->timeout_read)) \
429 event_add(&(bev)->ev_read, &(bev)->timeout_read); \
433 #define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev) \ argument
[all …]
Diocp-internal.h192 void bufferevent_async_set_connected_(struct bufferevent *bev);
193 int bufferevent_async_can_connect_(struct bufferevent *bev);
194 int bufferevent_async_connect_(struct bufferevent *bev, evutil_socket_t fd,
Dratelim-internal.h87 int bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev,
Devbuffer-internal.h338 void evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev);
Dhttp.c2338 …_base_bufferevent_new(struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, in evhttp_connection_base_bufferevent_new() argument
2364 if (bev == NULL) { in evhttp_connection_base_bufferevent_new()
2365 if (!(bev = bufferevent_socket_new(base, -1, 0))) { in evhttp_connection_base_bufferevent_new()
2371 bufferevent_setcb(bev, evhttp_read_cb, evhttp_write_cb, evhttp_error_cb, evcon); in evhttp_connection_base_bufferevent_new()
2372 evcon->bufev = bev; in evhttp_connection_base_bufferevent_new()
2382 if (bufferevent_get_base(bev) != base) in evhttp_connection_base_bufferevent_new()
2388 bufferevent_get_priority(bev), in evhttp_connection_base_bufferevent_new()
4170 struct bufferevent* bev = NULL; in evhttp_get_request_connection() local
4184 bev = (*http->bevcb)(http->base, http->bevcbarg); in evhttp_get_request_connection()
4187 http->base, NULL, bev, hostname, atoi(portname)); in evhttp_get_request_connection()
/external/libevent/test/
Dtest-fdleak.c82 server_read_cb(struct bufferevent *bev, void *ctx) in server_read_cb() argument
84 while (evbuffer_get_length(bufferevent_get_input(bev))) { in server_read_cb()
86 bufferevent_read(bev, &tmp, 1); in server_read_cb()
87 bufferevent_write(bev, &tmp, 1); in server_read_cb()
93 server_event_cb(struct bufferevent *bev, short events, void *ctx) in server_event_cb() argument
99 bufferevent_free(bev); in server_event_cb()
109 struct bufferevent *bev = bufferevent_socket_new(base, sock, in listener_accept_cb() local
112 bufferevent_setcb(bev, server_read_cb, NULL, server_event_cb, NULL); in listener_accept_cb()
113 bufferevent_enable(bev, EV_READ|EV_WRITE); in listener_accept_cb()
168 client_read_cb(struct bufferevent *bev, void *ctx) in client_read_cb() argument
[all …]
Dregress_bufferevent.c92 readcb(struct bufferevent *bev, void *arg) in readcb() argument
94 if (evbuffer_get_length(bev->input) == 8333) { in readcb()
99 bufferevent_read_buffer(bev, evbuf); in readcb()
101 bufferevent_disable(bev, EV_READ); in readcb()
112 writecb(struct bufferevent *bev, void *arg) in writecb() argument
114 if (evbuffer_get_length(bev->output) == 0) { in writecb()
120 errorcb(struct bufferevent *bev, short what, void *arg) in errorcb() argument
354 wm_readcb(struct bufferevent *bev, void *arg) in wm_readcb() argument
357 int len = (int)evbuffer_get_length(bev->input); in wm_readcb()
365 bufferevent_read_buffer(bev, evbuf); in wm_readcb()
[all …]
Dregress_ssl.c235 bufferevent_openssl_check_fd(struct bufferevent *bev, int filter) in bufferevent_openssl_check_fd() argument
237 tt_int_op(bufferevent_getfd(bev), !=, -1); in bufferevent_openssl_check_fd()
238 tt_int_op(bufferevent_setfd(bev, -1), ==, 0); in bufferevent_openssl_check_fd()
240 tt_int_op(bufferevent_getfd(bev), !=, -1); in bufferevent_openssl_check_fd()
242 tt_int_op(bufferevent_getfd(bev), ==, -1); in bufferevent_openssl_check_fd()
249 bufferevent_openssl_check_freed(struct bufferevent *bev) in bufferevent_openssl_check_freed() argument
251 tt_int_op(event_pending(&bev->ev_read, EVLIST_ALL, NULL), ==, 0); in bufferevent_openssl_check_freed()
252 tt_int_op(event_pending(&bev->ev_write, EVLIST_ALL, NULL), ==, 0); in bufferevent_openssl_check_freed()
259 respond_to_number(struct bufferevent *bev, void *ctx) in respond_to_number() argument
261 struct evbuffer *b = bufferevent_get_input(bev); in respond_to_number()
[all …]
Dtest-ratelim.c112 loud_writecb(struct bufferevent *bev, void *ctx) in loud_writecb() argument
115 struct evbuffer *output = bufferevent_get_output(bev); in loud_writecb()
126 discard_readcb(struct bufferevent *bev, void *ctx) in discard_readcb() argument
129 struct evbuffer *input = bufferevent_get_input(bev); in discard_readcb()
136 write_on_connectedcb(struct bufferevent *bev, short what, void *ctx) in write_on_connectedcb() argument
139 loud_writecb(bev, ctx); in write_on_connectedcb()
141 bufferevent_enable(bev, EV_READ|EV_WRITE); in write_on_connectedcb()
146 echo_readcb(struct bufferevent *bev, void *ctx) in echo_readcb() argument
148 struct evbuffer *input = bufferevent_get_input(bev); in echo_readcb()
149 struct evbuffer *output = bufferevent_get_output(bev); in echo_readcb()
[all …]
Dregress_http.c243 http_readcb(struct bufferevent *bev, void *arg) in http_readcb() argument
248 if (evbuffer_contains(bufferevent_get_input(bev), what)) { in http_readcb()
253 done = evhttp_parse_firstline_(req, bufferevent_get_input(bev)); in http_readcb()
257 done = evhttp_parse_headers_(req, bufferevent_get_input(bev)); in http_readcb()
268 bufferevent_disable(bev, EV_READ); in http_readcb()
281 http_writecb(struct bufferevent *bev, void *arg) in http_writecb() argument
283 if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) { in http_writecb()
285 bufferevent_enable(bev, EV_READ); in http_writecb()
291 http_errorcb(struct bufferevent *bev, short what, void *arg) in http_errorcb() argument
420 struct bufferevent *bev = arg; in http_complete_write() local
[all …]
Dregress_zlib.c243 readcb(struct bufferevent *bev, void *arg) in readcb() argument
245 if (evbuffer_get_length(bufferevent_get_input(bev)) == 8333) { in readcb()
250 bufferevent_read_buffer(bev, evbuf); in readcb()
252 bufferevent_disable(bev, EV_READ); in readcb()
263 writecb(struct bufferevent *bev, void *arg) in writecb() argument
265 if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) { in writecb()
271 errorcb(struct bufferevent *bev, short what, void *arg) in errorcb() argument
Dregress_iocp.c297 async_readcb(struct bufferevent *bev, void *arg) in async_readcb() argument
300 bufferevent_disable(bev, EV_READ); in async_readcb()
/external/libevent/sample/
Dhello-world.c93 struct bufferevent *bev; in listener_cb() local
95 bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE); in listener_cb()
96 if (!bev) { in listener_cb()
101 bufferevent_setcb(bev, NULL, conn_writecb, conn_eventcb, NULL); in listener_cb()
102 bufferevent_enable(bev, EV_WRITE); in listener_cb()
103 bufferevent_disable(bev, EV_READ); in listener_cb()
105 bufferevent_write(bev, MESSAGE, strlen(MESSAGE)); in listener_cb()
109 conn_writecb(struct bufferevent *bev, void *user_data) in conn_writecb() argument
111 struct evbuffer *output = bufferevent_get_output(bev); in conn_writecb()
114 bufferevent_free(bev); in conn_writecb()
[all …]
Dle-proxy.c48 static void drained_writecb(struct bufferevent *bev, void *ctx);
49 static void eventcb(struct bufferevent *bev, short what, void *ctx);
52 readcb(struct bufferevent *bev, void *ctx) in readcb() argument
57 src = bufferevent_get_input(bev); in readcb()
71 eventcb, bev); in readcb()
74 bufferevent_disable(bev, EV_READ); in readcb()
79 drained_writecb(struct bufferevent *bev, void *ctx) in drained_writecb() argument
85 bufferevent_setcb(bev, readcb, NULL, eventcb, partner); in drained_writecb()
86 bufferevent_setwatermark(bev, EV_WRITE, 0, 0); in drained_writecb()
92 close_on_finished_writecb(struct bufferevent *bev, void *ctx) in close_on_finished_writecb() argument
[all …]
Dhttps-client.c61 struct bufferevent *bev = (struct bufferevent *) ctx; in http_request_done() local
68 while ((oslerr = bufferevent_get_openssl_error(bev))) { in http_request_done()
203 struct bufferevent *bev; in main() local
395 bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE); in main()
398 bev = bufferevent_openssl_socket_new(base, -1, ssl, in main()
403 if (bev == NULL) { in main()
408 bufferevent_openssl_set_allow_dirty_shutdown(bev, 1); in main()
412 evcon = evhttp_connection_base_bufferevent_new(base, NULL, bev, in main()
427 req = evhttp_request_new(http_request_done, bev); in main()
/external/libevent/include/event2/
Dbufferevent.h135 typedef void (*bufferevent_data_cb)(struct bufferevent *bev, void *ctx);
154 typedef void (*bufferevent_event_cb)(struct bufferevent *bev, short what, void *ctx);
254 int bufferevent_socket_get_dns_error(struct bufferevent *bev);
274 struct event_base *bufferevent_get_base(struct bufferevent *bev);
746 struct bufferevent *bufferevent_pair_get_partner(struct bufferevent *bev);
805 int bufferevent_set_rate_limit(struct bufferevent *bev,
877 int bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
882 int bufferevent_remove_from_rate_limit_group(struct bufferevent *bev);
892 int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
902 int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
[all …]
Dbufferevent_ssl.h110 int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev);
112 void bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
122 int bufferevent_ssl_renegotiate(struct bufferevent *bev);
126 unsigned long bufferevent_get_openssl_error(struct bufferevent *bev);
Dhttp.h523 …struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address,…

12