Sanity-check arguments to event_base_active_by_fd()

This commit is contained in:
Nick Mathewson 2013-12-21 23:21:33 -05:00
parent 93369ff4e9
commit 5c9da9a8a8
2 changed files with 5 additions and 4 deletions

View File

@ -3636,7 +3636,7 @@ void
event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events)
{
EVBASE_ACQUIRE_LOCK(base, th_base_lock);
evmap_io_active_(base, fd, events);
evmap_io_active_(base, fd, events & (EV_READ|EV_WRITE|EV_TIMEOUT));
EVBASE_RELEASE_LOCK(base, th_base_lock);
}

View File

@ -1465,10 +1465,11 @@ void event_base_dump_events(struct event_base *, FILE *);
/**
Activates all events for the given fd and event mask.
Activates all pending events for the given fd and event mask.
@param fd An fd or signal
@param events One or more EV_* flags
@param base the event_base on which to activate the events.
@param fd An fd to active events on.
@param events One or more of EV_{READ,WRITE,TIMEOUT}.
*/
void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);