From 21350d07dbaf0f0c1c94bf498667f3c893cc420b Mon Sep 17 00:00:00 2001 From: lurchi Date: Thu, 18 Jan 2018 16:25:10 +0100 Subject: [PATCH] fix loop responsible for finding tasks with expired timeout --- src/util/scheduler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/scheduler.c b/src/util/scheduler.c index b262b14d7..1e52dce9f 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -1885,8 +1885,10 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) /* check for tasks that reached the timeout! */ now = GNUNET_TIME_absolute_get (); - while (NULL != (pos = pending_timeout_head)) + pos = pending_timeout_head; + while (NULL != pos) { + struct GNUNET_SCHEDULER_Task *next = pos->next; if (now.abs_value_us >= pos->timeout.abs_value_us) pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; if (0 == pos->reason) @@ -1897,6 +1899,7 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) if (pending_timeout_last == pos) pending_timeout_last = NULL; queue_ready_task (pos); + pos = next; } pos = pending_head; while (NULL != pos) -- 2.25.1