libevent
libevent copied to clipboard
bufferevent_priority_set doesn't work so well
If bufferevent_priority_set() is to work, it needs to change the priority assigned to every future event and callback. But events and callbacks can be initialized after bufferevent_priority_set() is called -- for example, in be_socket_setfd.
Further, it should really affect the priority of events used to implement rate-limiting.
@libevent/maintainers 2.2 instead of 2.1?
Hm, but event_priority_set()
set the ev_pri
field and nobody reset it after, i.e. event_del()
/event_assign()
(from be_socket_setfd()
) does not reset them, so @nmathewson everything works or I missing something?
As for ratelimit, will be enough to add event_priority_set(refill_bucket_event/master_refill_event, bufferevent_priority_get(bev))
?