]> granicus.if.org Git - libevent/commitdiff
Correctly detect failure to delete bufferevent read-timeout event
authorNick Mathewson <nickm@torproject.org>
Tue, 17 Aug 2010 17:26:03 +0000 (13:26 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 Aug 2010 17:26:03 +0000 (13:26 -0400)
Gilad Benjamini noted that we check the error code for deleting a
write-timeout event twice, and the read timeout not at all.  This
shouldn't be a bit problem, since it's really hard for a delete to
fail on a timeout-only event, but it's worth fixing.

Fixes bug 3046787

bufferevent.c

index 9080c5e21a614a5107717ced1eb1cc369cff7cbf..9923bbe0dab4019a769c3f473276d0fec9a638b9 100644 (file)
@@ -788,7 +788,7 @@ _bufferevent_del_generic_timeout_cbs(struct bufferevent *bev)
        int r1,r2;
        r1 = event_del(&bev->ev_read);
        r2 = event_del(&bev->ev_write);
-       if (r2<0 || r2<0)
+       if (r1<0 || r2<0)
                return -1;
        return 0;
 }