diff options
author | lurchi <lurchi@strangeplace.net> | 2018-01-18 16:25:10 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2018-01-18 16:25:10 +0100 |
commit | 21350d07dbaf0f0c1c94bf498667f3c893cc420b (patch) | |
tree | 2750a0af7a1548ea453aa1918864dc191d4b8a40 /src/util/scheduler.c | |
parent | 0ca9f471786bc57f852f78bd7dfa5aadddc99b9e (diff) | |
download | gnunet-21350d07dbaf0f0c1c94bf498667f3c893cc420b.tar.gz gnunet-21350d07dbaf0f0c1c94bf498667f3c893cc420b.zip |
fix loop responsible for finding tasks with expired timeout
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r-- | src/util/scheduler.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) | |||
1885 | 1885 | ||
1886 | /* check for tasks that reached the timeout! */ | 1886 | /* check for tasks that reached the timeout! */ |
1887 | now = GNUNET_TIME_absolute_get (); | 1887 | now = GNUNET_TIME_absolute_get (); |
1888 | while (NULL != (pos = pending_timeout_head)) | 1888 | pos = pending_timeout_head; |
1889 | while (NULL != pos) | ||
1889 | { | 1890 | { |
1891 | struct GNUNET_SCHEDULER_Task *next = pos->next; | ||
1890 | if (now.abs_value_us >= pos->timeout.abs_value_us) | 1892 | if (now.abs_value_us >= pos->timeout.abs_value_us) |
1891 | pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; | 1893 | pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; |
1892 | if (0 == pos->reason) | 1894 | if (0 == pos->reason) |
@@ -1897,6 +1899,7 @@ GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh) | |||
1897 | if (pending_timeout_last == pos) | 1899 | if (pending_timeout_last == pos) |
1898 | pending_timeout_last = NULL; | 1900 | pending_timeout_last = NULL; |
1899 | queue_ready_task (pos); | 1901 | queue_ready_task (pos); |
1902 | pos = next; | ||
1900 | } | 1903 | } |
1901 | pos = pending_head; | 1904 | pos = pending_head; |
1902 | while (NULL != pos) | 1905 | while (NULL != pos) |