]> granicus.if.org Git - libevent/commitdiff
Sanity-check arguments to event_base_active_by_fd()
authorNick Mathewson <nickm@torproject.org>
Sun, 22 Dec 2013 04:21:33 +0000 (23:21 -0500)
committerNick Mathewson <nickm@torproject.org>
Sun, 22 Dec 2013 04:21:33 +0000 (23:21 -0500)
event.c
include/event2/event.h

diff --git a/event.c b/event.c
index ed9a89813b782a9dd8b50cb1b1921e6fbd4aa97b..7a2cb20d7d0d59e4e9b25f7a7e3da6f0c422d747 100644 (file)
--- a/event.c
+++ b/event.c
@@ -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);
 }
 
index 2c93e9ab7ef8d57fff4beecea1cd56046ddb3827..b081429c54ff9bfcc0f750df519b1e1460c0eae3 100644 (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);