From 5e905c9dd52a601d0af581c28ca3c96e7163b79b Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 17 Jul 2008 14:09:07 +0000 Subject: [PATCH] if we change the timeouts on bufferevents, we might have to readd pending events svn:r911 --- bufferevent.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bufferevent.c b/bufferevent.c index 4d74de26..4082f53f 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -531,6 +531,11 @@ bufferevent_settimeout(struct bufferevent *bufev, int timeout_read, int timeout_write) { bufev->timeout_read = timeout_read; bufev->timeout_write = timeout_write; + + if (event_pending(&bufev->ev_read, EV_READ, NULL)) + bufferevent_add(&bufev->ev_read, timeout_read); + if (event_pending(&bufev->ev_write, EV_WRITE, NULL)) + bufferevent_add(&bufev->ev_write, timeout_write); } /*