From: lurchi Date: Wed, 17 Jan 2018 17:02:27 +0000 (+0100) Subject: always check priority given by users X-Git-Tag: v0.11.0pre66~248^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ca9f471786bc57f852f78bd7dfa5aadddc99b9e;p=oweals%2Fgnunet.git always check priority given by users --- diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 0e7a16275..b262b14d7 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -994,7 +994,7 @@ GNUNET_SCHEDULER_add_with_reason_and_priority (GNUNET_SCHEDULER_TaskCallback tas t->start_time = GNUNET_TIME_absolute_get (); #endif t->reason = reason; - t->priority = priority; + t->priority = check_priority (priority); t->lifeness = current_lifeness; LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding continuation task %p\n", @@ -1036,7 +1036,7 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, t->start_time = GNUNET_TIME_absolute_get (); #endif t->timeout = at; - t->priority = priority; + t->priority = check_priority (priority); t->lifeness = current_lifeness; /* try tail first (optimization in case we are * appending to a long list of tasks with timeouts) */ @@ -1095,8 +1095,8 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, */ struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, - enum GNUNET_SCHEDULER_Priority priority, - GNUNET_SCHEDULER_TaskCallback task, + enum GNUNET_SCHEDULER_Priority priority, + GNUNET_SCHEDULER_TaskCallback task, void *task_cls) { return GNUNET_SCHEDULER_add_at_with_priority (GNUNET_TIME_relative_to_absolute (delay), @@ -2305,8 +2305,8 @@ select_loop (void *cls, void -select_set_wakeup(void *cls, - struct GNUNET_TIME_Absolute dt) +select_set_wakeup (void *cls, + struct GNUNET_TIME_Absolute dt) { struct DriverContext *context = cls; GNUNET_assert (NULL != context);