dovecot-1.1: ioloop: 0 ms timeouts could still have caused infin...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Nov 30 15:04:45 EET 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/250cbb06d4f9
changeset: 8028:250cbb06d4f9
user: Timo Sirainen <tss at iki.fi>
date: Sun Nov 30 15:04:41 2008 +0200
description:
ioloop: 0 ms timeouts could still have caused infinite looping.
diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
src/lib/ioloop.c | 5 +++--
diffs (15 lines):
diff -r 75f36619846f -r 250cbb06d4f9 src/lib/ioloop.c
--- a/src/lib/ioloop.c Sun Nov 30 04:20:03 2008 +0200
+++ b/src/lib/ioloop.c Sun Nov 30 15:04:41 2008 +0200
@@ -155,8 +155,9 @@ timeout_reset_timeval(struct timeout *ti
if (timeout->msecs == 0) {
/* if we came here from io_loop_handle_timeouts(),
next_run must be larger than tv_now or we could go to
- infinite loop */
- timeout->next_run.tv_usec += 1000;
+ infinite loop. +1000 to get 1 ms further, another +1000 to
+ account for timeout_update_next()'s truncation. */
+ timeout->next_run.tv_usec += 2000;
if (timeout->next_run.tv_usec >= 1000000) {
timeout->next_run.tv_sec++;
timeout->next_run.tv_usec -= 1000000;
More information about the dovecot-cvs
mailing list