diff options
author | lurchi <lurchi@strangeplace.net> | 2018-01-17 18:02:27 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2018-01-17 18:02:27 +0100 |
commit | 0ca9f471786bc57f852f78bd7dfa5aadddc99b9e (patch) | |
tree | 10ae84c02bd125c0a3c9422de5d532d66b51cdde | |
parent | fc3aa3c0764eb1eca804ae6bee2145b7886d7e62 (diff) | |
download | gnunet-0ca9f471786bc57f852f78bd7dfa5aadddc99b9e.tar.gz gnunet-0ca9f471786bc57f852f78bd7dfa5aadddc99b9e.zip |
always check priority given by users
-rw-r--r-- | src/util/scheduler.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 | |||
994 | t->start_time = GNUNET_TIME_absolute_get (); | 994 | t->start_time = GNUNET_TIME_absolute_get (); |
995 | #endif | 995 | #endif |
996 | t->reason = reason; | 996 | t->reason = reason; |
997 | t->priority = priority; | 997 | t->priority = check_priority (priority); |
998 | t->lifeness = current_lifeness; | 998 | t->lifeness = current_lifeness; |
999 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 999 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1000 | "Adding continuation task %p\n", | 1000 | "Adding continuation task %p\n", |
@@ -1036,7 +1036,7 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | |||
1036 | t->start_time = GNUNET_TIME_absolute_get (); | 1036 | t->start_time = GNUNET_TIME_absolute_get (); |
1037 | #endif | 1037 | #endif |
1038 | t->timeout = at; | 1038 | t->timeout = at; |
1039 | t->priority = priority; | 1039 | t->priority = check_priority (priority); |
1040 | t->lifeness = current_lifeness; | 1040 | t->lifeness = current_lifeness; |
1041 | /* try tail first (optimization in case we are | 1041 | /* try tail first (optimization in case we are |
1042 | * appending to a long list of tasks with timeouts) */ | 1042 | * appending to a long list of tasks with timeouts) */ |
@@ -1095,8 +1095,8 @@ GNUNET_SCHEDULER_add_at_with_priority (struct GNUNET_TIME_Absolute at, | |||
1095 | */ | 1095 | */ |
1096 | struct GNUNET_SCHEDULER_Task * | 1096 | struct GNUNET_SCHEDULER_Task * |
1097 | GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, | 1097 | GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, |
1098 | enum GNUNET_SCHEDULER_Priority priority, | 1098 | enum GNUNET_SCHEDULER_Priority priority, |
1099 | GNUNET_SCHEDULER_TaskCallback task, | 1099 | GNUNET_SCHEDULER_TaskCallback task, |
1100 | void *task_cls) | 1100 | void *task_cls) |
1101 | { | 1101 | { |
1102 | return GNUNET_SCHEDULER_add_at_with_priority (GNUNET_TIME_relative_to_absolute (delay), | 1102 | return GNUNET_SCHEDULER_add_at_with_priority (GNUNET_TIME_relative_to_absolute (delay), |
@@ -2305,8 +2305,8 @@ select_loop (void *cls, | |||
2305 | 2305 | ||
2306 | 2306 | ||
2307 | void | 2307 | void |
2308 | select_set_wakeup(void *cls, | 2308 | select_set_wakeup (void *cls, |
2309 | struct GNUNET_TIME_Absolute dt) | 2309 | struct GNUNET_TIME_Absolute dt) |
2310 | { | 2310 | { |
2311 | struct DriverContext *context = cls; | 2311 | struct DriverContext *context = cls; |
2312 | GNUNET_assert (NULL != context); | 2312 | GNUNET_assert (NULL != context); |