Correctly detect failure to delete bufferevent read-timeout event

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
This commit is contained in:
Nick Mathewson 2010-08-17 13:26:03 -04:00
parent 5fb1095824
commit da6e7cd495

View 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;
}