diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/topology | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 632cfc4ec..1a6c163ee 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -506,19 +506,19 @@ find_advertisable_hello (void *cls, | |||
506 | * peer and ask for it. | 506 | * peer and ask for it. |
507 | * | 507 | * |
508 | * @param cls for which peer to schedule the HELLO | 508 | * @param cls for which peer to schedule the HELLO |
509 | * @param tc task context | ||
510 | */ | 509 | */ |
511 | static void | 510 | static void |
512 | schedule_next_hello (void *cls, | 511 | schedule_next_hello (void *cls) |
513 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
514 | { | 512 | { |
515 | struct Peer *pl = cls; | 513 | struct Peer *pl = cls; |
516 | struct FindAdvHelloContext fah; | 514 | struct FindAdvHelloContext fah; |
517 | size_t next_want; | 515 | size_t next_want; |
518 | struct GNUNET_TIME_Relative delay; | 516 | struct GNUNET_TIME_Relative delay; |
517 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
519 | 518 | ||
520 | pl->hello_delay_task = NULL; | 519 | pl->hello_delay_task = NULL; |
521 | GNUNET_assert (GNUNET_YES == pl->is_connected); | 520 | GNUNET_assert (GNUNET_YES == pl->is_connected); |
521 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
522 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 522 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
523 | return; /* we're out of here */ | 523 | return; /* we're out of here */ |
524 | if (pl->hello_req != NULL) | 524 | if (pl->hello_req != NULL) |
@@ -669,11 +669,9 @@ try_add_peers (void *cls, | |||
669 | * Add peers and schedule connection attempt | 669 | * Add peers and schedule connection attempt |
670 | * | 670 | * |
671 | * @param cls unused, NULL | 671 | * @param cls unused, NULL |
672 | * @param tc scheduler context | ||
673 | */ | 672 | */ |
674 | static void | 673 | static void |
675 | add_peer_task (void *cls, | 674 | add_peer_task (void *cls) |
676 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
677 | { | 675 | { |
678 | add_task = NULL; | 676 | add_task = NULL; |
679 | 677 | ||
@@ -1133,11 +1131,9 @@ hello_advertising_ready (void *cls, | |||
1133 | * the transport and core. | 1131 | * the transport and core. |
1134 | * | 1132 | * |
1135 | * @param cls unused, NULL | 1133 | * @param cls unused, NULL |
1136 | * @param tc scheduler context | ||
1137 | */ | 1134 | */ |
1138 | static void | 1135 | static void |
1139 | cleaning_task (void *cls, | 1136 | cleaning_task (void *cls) |
1140 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1141 | { | 1137 | { |
1142 | if (NULL != peerinfo_notify) | 1138 | if (NULL != peerinfo_notify) |
1143 | { | 1139 | { |