[BUG] wqueue: perform proper timeout comparisons with wrapping values

With wrapping keys, we cannot simply do "if (key > now)", but
we must at least do "if ((signed)(key-now) > 0)".
This commit is contained in:
Willy Tarreau 2008-06-29 10:25:57 +02:00
parent accc4e1e86
commit e62bdd4026

View File

@ -148,7 +148,7 @@ void wake_expired_tasks(struct timeval *next)
struct eb32_node *next_eb;
task = eb32_entry(eb, struct task, eb);
if (eb->key > now_key) {
if ((signed)(eb->key - now_key) > 0) {
*next = task->expire;
timers.first = task->expire;
return;