From: lurchi Date: Thu, 18 Jan 2018 15:25:10 +0000 (+0100) Subject: fix loop responsible for finding tasks with expired timeout X-Git-Tag: v0.11.0pre66~248^2~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=21350d07dbaf0f0c1c94bf498667f3c893cc420b;p=oweals%2Fgnunet.git fix loop responsible for finding tasks with expired timeout --- 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)