Lines Matching refs:bev
92 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()
369 bufferevent_disable(bev, EV_READ); in wm_readcb()
377 wm_writecb(struct bufferevent *bev, void *arg) in wm_writecb() argument
379 assert(evbuffer_get_length(bev->output) <= 100); in wm_writecb()
380 if (evbuffer_get_length(bev->output) == 0) { in wm_writecb()
381 evbuffer_drain(bev->output, evbuffer_get_length(bev->output)); in wm_writecb()
387 wm_errorcb(struct bufferevent *bev, short what, void *arg) in wm_errorcb() argument
604 sender_writecb(struct bufferevent *bev, void *ctx) in sender_writecb() argument
606 if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) { in sender_writecb()
607 bufferevent_disable(bev,EV_READ|EV_WRITE); in sender_writecb()
608 TT_BLATHER(("Flushed %d: freeing it.", (int)bufferevent_getfd(bev))); in sender_writecb()
609 bufferevent_free(bev); in sender_writecb()
614 sender_errorcb(struct bufferevent *bev, short what, void *ctx) in sender_errorcb() argument
632 struct bufferevent *bev; in listen_cb() local
635 bev = bufferevent_socket_new(base, fd, bufferevent_connect_test_flags); in listen_cb()
636 tt_assert(bev); in listen_cb()
637 bufferevent_setcb(bev, NULL, sender_writecb, sender_errorcb, NULL); in listen_cb()
638 bufferevent_write(bev, s, sizeof(s)); in listen_cb()
669 reader_eventcb(struct bufferevent *bev, short what, void *ctx) in reader_eventcb() argument
678 TT_BLATHER(("connected on %d", (int)bufferevent_getfd(bev))); in reader_eventcb()
679 bufferevent_enable(bev, EV_READ); in reader_eventcb()
684 n = bufferevent_read(bev, buf, sizeof(buf)-1); in reader_eventcb()
691 (int)bufferevent_getfd(bev), n_strings_read)); in reader_eventcb()
698 reader_eventcb_simple(struct bufferevent *bev, short what, void *ctx) in reader_eventcb_simple() argument
701 (int)bufferevent_getfd(bev))); in reader_eventcb_simple()
706 reader_readcb(struct bufferevent *bev, void *ctx) in reader_readcb() argument
708 TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev))); in reader_readcb()
795 struct bufferevent *bev = NULL; in test_bufferevent_connect_fail_eventcb() local
805 bev = bufferevent_socket_new(data->base, -1, flags); in test_bufferevent_connect_fail_eventcb()
806 tt_assert(bev); in test_bufferevent_connect_fail_eventcb()
807 bufferevent_setcb(bev, reader_readcb, reader_readcb, in test_bufferevent_connect_fail_eventcb()
809 bufferevent_enable(bev, EV_READ|EV_WRITE); in test_bufferevent_connect_fail_eventcb()
813 bufferevent_socket_connect(bev, (struct sockaddr *)&localhost, slen); in test_bufferevent_connect_fail_eventcb()
823 if (bev) in test_bufferevent_connect_fail_eventcb()
824 bufferevent_free(bev); in test_bufferevent_connect_fail_eventcb()
830 want_fail_eventcb(struct bufferevent *bev, short what, void *ctx) in want_fail_eventcb() argument
837 s = bufferevent_getfd(bev); in want_fail_eventcb()
863 struct bufferevent *bev=NULL; in test_bufferevent_connect_fail() local
875 bev = bufferevent_socket_new(data->base, -1, in test_bufferevent_connect_fail()
877 tt_assert(bev); in test_bufferevent_connect_fail()
878 bufferevent_setcb(bev, NULL, NULL, want_fail_eventcb, data->base); in test_bufferevent_connect_fail()
880 r = bufferevent_socket_connect(bev, (struct sockaddr *)&localhost, slen); in test_bufferevent_connect_fail()
900 if (bev) in test_bufferevent_connect_fail()
901 bufferevent_free(bev); in test_bufferevent_connect_fail()
917 bev_timeout_write_cb(struct bufferevent *bev, void *arg) in bev_timeout_write_cb() argument
924 bev_timeout_event_cb(struct bufferevent *bev, short what, void *arg) in bev_timeout_event_cb() argument
1056 trigger_eventcb(struct bufferevent *bev, short what, void *ctx) in trigger_eventcb() argument
1064 reader_eventcb(bev, what, ctx); in trigger_eventcb()
1068 trigger_readcb_triggered(struct bufferevent *bev, void *ctx) in trigger_readcb_triggered() argument
1072 bufferevent_trigger_event(bev, ~0, bufferevent_trigger_test_flags); in trigger_readcb_triggered()
1076 trigger_readcb(struct bufferevent *bev, void *ctx) in trigger_readcb() argument
1083 TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev))); in trigger_readcb()
1086 bufferevent_setcb(bev, trigger_readcb_triggered, NULL, trigger_eventcb, ctx); in trigger_readcb()
1088 bufferevent_getwatermark(bev, EV_READ, &low, &high); in trigger_readcb()
1089 len = evbuffer_get_length(bufferevent_get_input(bev)); in trigger_readcb()
1091 bufferevent_setwatermark(bev, EV_READ, len + 1, 0); in trigger_readcb()
1092 bufferevent_trigger(bev, EV_READ, bufferevent_trigger_test_flags); in trigger_readcb()
1105 bufferevent_trigger(bev, EV_READ, in trigger_readcb()
1109 bufferevent_setwatermark(bev, EV_READ, low, high); in trigger_readcb()
1119 struct bufferevent *bev=NULL; in test_bufferevent_trigger() local
1156 bev = bufferevent_socket_new(data->base, -1, be_flags); in test_bufferevent_trigger()
1157 tt_assert(bev); in test_bufferevent_trigger()
1158 bufferevent_setcb(bev, trigger_readcb, NULL, trigger_eventcb, data->base); in test_bufferevent_trigger()
1160 bufferevent_enable(bev, EV_READ); in test_bufferevent_trigger()
1162 tt_want(!bufferevent_socket_connect(bev, sa, sizeof(localhost))); in test_bufferevent_trigger()
1171 if (bev) in test_bufferevent_trigger()
1172 bufferevent_free(bev); in test_bufferevent_trigger()
1179 struct bufferevent *bev = NULL, *bevf = NULL; in test_bufferevent_socket_filter_inactive() local
1181 bev = bufferevent_socket_new(data->base, -1, 0); in test_bufferevent_socket_filter_inactive()
1182 tt_assert(bev); in test_bufferevent_socket_filter_inactive()
1183 bevf = bufferevent_filter_new(bev, NULL, NULL, 0, NULL, NULL); in test_bufferevent_socket_filter_inactive()
1189 if (bev) in test_bufferevent_socket_filter_inactive()
1190 bufferevent_free(bev); in test_bufferevent_socket_filter_inactive()
1194 pair_flush_eventcb(struct bufferevent *bev, short what, void *ctx) in pair_flush_eventcb() argument
1236 bufferevent_filter_data_stuck_readcb(struct bufferevent *bev, void *arg) in bufferevent_filter_data_stuck_readcb() argument
1239 struct evbuffer *input = bufferevent_get_input(bev); in bufferevent_filter_data_stuck_readcb()