Lines Matching refs:bev
63 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_()
241 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_run_writecb_()
270 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_run_eventcb_()
296 struct bufferevent *bufev = &bufev_private->bev; in bufferevent_init_common_()
463 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_enable()
537 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_disable_hard_()
574 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_setwatermark()
687 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_decref_and_unlock_()
731 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_finalize_cb_()
798 EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); in bufferevent_incref()
846 bufferevent_setfd(struct bufferevent *bev, evutil_socket_t fd) in bufferevent_setfd() argument
851 BEV_LOCK(bev); in bufferevent_setfd()
852 if (bev->be_ops->ctrl) in bufferevent_setfd()
853 res = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d); in bufferevent_setfd()
854 BEV_UNLOCK(bev); in bufferevent_setfd()
859 bufferevent_getfd(struct bufferevent *bev) in bufferevent_getfd() argument
864 BEV_LOCK(bev); in bufferevent_getfd()
865 if (bev->be_ops->ctrl) in bufferevent_getfd()
866 res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d); in bufferevent_getfd()
867 BEV_UNLOCK(bev); in bufferevent_getfd()
872 bufferevent_get_options_(struct bufferevent *bev) in bufferevent_get_options_() argument
875 EVUTIL_UPCAST(bev, struct bufferevent_private, bev); in bufferevent_get_options_()
878 BEV_LOCK(bev); in bufferevent_get_options_()
880 BEV_UNLOCK(bev); in bufferevent_get_options_()
886 bufferevent_cancel_all_(struct bufferevent *bev) in bufferevent_cancel_all_() argument
890 BEV_LOCK(bev); in bufferevent_cancel_all_()
891 if (bev->be_ops->ctrl) in bufferevent_cancel_all_()
892 bev->be_ops->ctrl(bev, BEV_CTRL_CANCEL_ALL, &d); in bufferevent_cancel_all_()
893 BEV_UNLOCK(bev); in bufferevent_cancel_all_()
907 bufferevent_get_underlying(struct bufferevent *bev) in bufferevent_get_underlying() argument
912 BEV_LOCK(bev); in bufferevent_get_underlying()
913 if (bev->be_ops->ctrl) in bufferevent_get_underlying()
914 res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_UNDERLYING, &d); in bufferevent_get_underlying()
915 BEV_UNLOCK(bev); in bufferevent_get_underlying()
922 struct bufferevent *bev = ctx; in bufferevent_generic_read_timeout_cb() local
923 bufferevent_incref_and_lock_(bev); in bufferevent_generic_read_timeout_cb()
924 bufferevent_disable(bev, EV_READ); in bufferevent_generic_read_timeout_cb()
925 bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0); in bufferevent_generic_read_timeout_cb()
926 bufferevent_decref_and_unlock_(bev); in bufferevent_generic_read_timeout_cb()
931 struct bufferevent *bev = ctx; in bufferevent_generic_write_timeout_cb() local
932 bufferevent_incref_and_lock_(bev); in bufferevent_generic_write_timeout_cb()
933 bufferevent_disable(bev, EV_WRITE); in bufferevent_generic_write_timeout_cb()
934 bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0); in bufferevent_generic_write_timeout_cb()
935 bufferevent_decref_and_unlock_(bev); in bufferevent_generic_write_timeout_cb()
939 bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev) in bufferevent_init_generic_timeout_cbs_() argument
941 event_assign(&bev->ev_read, bev->ev_base, -1, EV_FINALIZE, in bufferevent_init_generic_timeout_cbs_()
942 bufferevent_generic_read_timeout_cb, bev); in bufferevent_init_generic_timeout_cbs_()
943 event_assign(&bev->ev_write, bev->ev_base, -1, EV_FINALIZE, in bufferevent_init_generic_timeout_cbs_()
944 bufferevent_generic_write_timeout_cb, bev); in bufferevent_init_generic_timeout_cbs_()
948 bufferevent_generic_adj_timeouts_(struct bufferevent *bev) in bufferevent_generic_adj_timeouts_() argument
950 const short enabled = bev->enabled; in bufferevent_generic_adj_timeouts_()
952 EVUTIL_UPCAST(bev, struct bufferevent_private, bev); in bufferevent_generic_adj_timeouts_()
955 evutil_timerisset(&bev->timeout_read)) in bufferevent_generic_adj_timeouts_()
956 r1 = event_add(&bev->ev_read, &bev->timeout_read); in bufferevent_generic_adj_timeouts_()
958 r1 = event_del(&bev->ev_read); in bufferevent_generic_adj_timeouts_()
961 evutil_timerisset(&bev->timeout_write) && in bufferevent_generic_adj_timeouts_()
962 evbuffer_get_length(bev->output)) in bufferevent_generic_adj_timeouts_()
963 r2 = event_add(&bev->ev_write, &bev->timeout_write); in bufferevent_generic_adj_timeouts_()
965 r2 = event_del(&bev->ev_write); in bufferevent_generic_adj_timeouts_()
972 bufferevent_generic_adj_existing_timeouts_(struct bufferevent *bev) in bufferevent_generic_adj_existing_timeouts_() argument
975 if (event_pending(&bev->ev_read, EV_READ, NULL)) { in bufferevent_generic_adj_existing_timeouts_()
976 if (evutil_timerisset(&bev->timeout_read)) { in bufferevent_generic_adj_existing_timeouts_()
977 if (bufferevent_add_event_(&bev->ev_read, &bev->timeout_read) < 0) in bufferevent_generic_adj_existing_timeouts_()
980 event_remove_timer(&bev->ev_read); in bufferevent_generic_adj_existing_timeouts_()
983 if (event_pending(&bev->ev_write, EV_WRITE, NULL)) { in bufferevent_generic_adj_existing_timeouts_()
984 if (evutil_timerisset(&bev->timeout_write)) { in bufferevent_generic_adj_existing_timeouts_()
985 if (bufferevent_add_event_(&bev->ev_write, &bev->timeout_write) < 0) in bufferevent_generic_adj_existing_timeouts_()
988 event_remove_timer(&bev->ev_write); in bufferevent_generic_adj_existing_timeouts_()
1006 bufferevent_lock(struct bufferevent *bev) in bufferevent_lock() argument
1008 bufferevent_incref_and_lock_(bev); in bufferevent_lock()
1012 bufferevent_unlock(struct bufferevent *bev) in bufferevent_unlock() argument
1014 bufferevent_decref_and_unlock_(bev); in bufferevent_unlock()