]> granicus.if.org Git - libevent/commitdiff
evport: Use portev_user to remember fdinfo struct
authorNick Mathewson <nickm@torproject.org>
Fri, 27 May 2011 18:22:50 +0000 (14:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 27 May 2011 19:10:45 +0000 (15:10 -0400)
evport.c

index 8b1c5f3e908733c00d806c49c1960503b698af4b..8ff39378c68b2a60d9ee33d8018b8b4277a9a6c8 100644 (file)
--- a/evport.c
+++ b/evport.c
@@ -177,7 +177,6 @@ check_event(port_event_t* pevt)
         * PORT_SOURCE_FD.
         */
        EVUTIL_ASSERT(pevt->portev_source == PORT_SOURCE_FD);
-       EVUTIL_ASSERT(pevt->portev_user == NULL);
 }
 
 #else
@@ -196,7 +195,7 @@ reassociate(struct evport_data *epdp, struct fd_info *fdip, int fd)
 
        if (sysevents != 0) {
                if (port_associate(epdp->ed_port, PORT_SOURCE_FD,
-                                  fd, sysevents, NULL) == -1) {
+                                  fd, sysevents, fdip) == -1) {
                        event_warn("port_associate");
                        return (-1);
                }
@@ -283,7 +282,8 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
        for (i = 0; i < nevents; ++i) {
                port_event_t *pevt = &pevtlist[i];
                int fd = (int) pevt->portev_object;
-               struct fd_info *fdi = evmap_io_get_fdinfo(&base->io, fd);
+               struct fd_info *fdi = pevt->portev_user;
+               //EVUTIL_ASSERT(evmap_io_get_fdinfo(&base->io, fd) == fdi);
 
                check_evportop(epdp);
                check_event(pevt);