Lines Matching refs:bevp

563 	struct bufferevent_private *bevp = BEV_UPCAST(bev);  in bufferevent_set_rate_limit()  local
574 if (bevp->rate_limiting) { in bufferevent_set_rate_limit()
575 rlim = bevp->rate_limiting; in bufferevent_set_rate_limit()
589 if (bevp->rate_limiting && bevp->rate_limiting->cfg == cfg) { in bufferevent_set_rate_limit()
594 if (bevp->rate_limiting == NULL) { in bufferevent_set_rate_limit()
598 bevp->rate_limiting = rlim; in bufferevent_set_rate_limit()
600 rlim = bevp->rate_limiting; in bufferevent_set_rate_limit()
612 -1, EV_FINALIZE, bev_refill_callback_, bevp); in bufferevent_set_rate_limit()
739 struct bufferevent_private *bevp = BEV_UPCAST(bev); in bufferevent_add_to_rate_limit_group() local
742 if (!bevp->rate_limiting) { in bufferevent_add_to_rate_limit_group()
750 -1, EV_FINALIZE, bev_refill_callback_, bevp); in bufferevent_add_to_rate_limit_group()
751 bevp->rate_limiting = rlim; in bufferevent_add_to_rate_limit_group()
754 if (bevp->rate_limiting->group == g) { in bufferevent_add_to_rate_limit_group()
758 if (bevp->rate_limiting->group) in bufferevent_add_to_rate_limit_group()
762 bevp->rate_limiting->group = g; in bufferevent_add_to_rate_limit_group()
764 LIST_INSERT_HEAD(&g->members, bevp, rate_limiting->next_in_group); in bufferevent_add_to_rate_limit_group()
790 struct bufferevent_private *bevp = BEV_UPCAST(bev); in bufferevent_remove_from_rate_limit_group_internal_() local
792 if (bevp->rate_limiting && bevp->rate_limiting->group) { in bufferevent_remove_from_rate_limit_group_internal_()
794 bevp->rate_limiting->group; in bufferevent_remove_from_rate_limit_group_internal_()
796 bevp->rate_limiting->group = NULL; in bufferevent_remove_from_rate_limit_group_internal_()
798 LIST_REMOVE(bevp, rate_limiting->next_in_group); in bufferevent_remove_from_rate_limit_group_internal_()
822 struct bufferevent_private *bevp; in bufferevent_get_read_limit() local
824 bevp = BEV_UPCAST(bev); in bufferevent_get_read_limit()
825 if (bevp->rate_limiting && bevp->rate_limiting->cfg) { in bufferevent_get_read_limit()
826 bufferevent_update_buckets(bevp); in bufferevent_get_read_limit()
827 r = bevp->rate_limiting->limit.read_limit; in bufferevent_get_read_limit()
841 struct bufferevent_private *bevp; in bufferevent_get_write_limit() local
843 bevp = BEV_UPCAST(bev); in bufferevent_get_write_limit()
844 if (bevp->rate_limiting && bevp->rate_limiting->cfg) { in bufferevent_get_write_limit()
845 bufferevent_update_buckets(bevp); in bufferevent_get_write_limit()
846 r = bevp->rate_limiting->limit.write_limit; in bufferevent_get_write_limit()
857 struct bufferevent_private *bevp; in bufferevent_set_max_single_read() local
859 bevp = BEV_UPCAST(bev); in bufferevent_set_max_single_read()
861 bevp->max_single_read = MAX_SINGLE_READ_DEFAULT; in bufferevent_set_max_single_read()
863 bevp->max_single_read = size; in bufferevent_set_max_single_read()
871 struct bufferevent_private *bevp; in bufferevent_set_max_single_write() local
873 bevp = BEV_UPCAST(bev); in bufferevent_set_max_single_write()
875 bevp->max_single_write = MAX_SINGLE_WRITE_DEFAULT; in bufferevent_set_max_single_write()
877 bevp->max_single_write = size; in bufferevent_set_max_single_write()
973 struct bufferevent_private *bevp; in bufferevent_decrement_read_limit() local
975 bevp = BEV_UPCAST(bev); in bufferevent_decrement_read_limit()
976 EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg); in bufferevent_decrement_read_limit()
977 old_limit = bevp->rate_limiting->limit.read_limit; in bufferevent_decrement_read_limit()
979 new_limit = (bevp->rate_limiting->limit.read_limit -= decr); in bufferevent_decrement_read_limit()
982 if (event_add(&bevp->rate_limiting->refill_bucket_event, in bufferevent_decrement_read_limit()
983 &bevp->rate_limiting->cfg->tick_timeout) < 0) in bufferevent_decrement_read_limit()
986 if (!(bevp->write_suspended & BEV_SUSPEND_BW)) in bufferevent_decrement_read_limit()
987 event_del(&bevp->rate_limiting->refill_bucket_event); in bufferevent_decrement_read_limit()
1002 struct bufferevent_private *bevp; in bufferevent_decrement_write_limit() local
1004 bevp = BEV_UPCAST(bev); in bufferevent_decrement_write_limit()
1005 EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg); in bufferevent_decrement_write_limit()
1006 old_limit = bevp->rate_limiting->limit.write_limit; in bufferevent_decrement_write_limit()
1008 new_limit = (bevp->rate_limiting->limit.write_limit -= decr); in bufferevent_decrement_write_limit()
1011 if (event_add(&bevp->rate_limiting->refill_bucket_event, in bufferevent_decrement_write_limit()
1012 &bevp->rate_limiting->cfg->tick_timeout) < 0) in bufferevent_decrement_write_limit()
1015 if (!(bevp->read_suspended & BEV_SUSPEND_BW)) in bufferevent_decrement_write_limit()
1016 event_del(&bevp->rate_limiting->refill_bucket_event); in bufferevent_decrement_write_limit()