aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/dht/gnunet-service-dht_neighbours.c
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
downloadgnunet-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/dht/gnunet-service-dht_neighbours.c')
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index cedafbd6c..d82effb34 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -492,11 +492,9 @@ find_bucket (const struct GNUNET_HashCode *hc)
492 * Clean up the "oh" field in the @a cls 492 * Clean up the "oh" field in the @a cls
493 * 493 *
494 * @param cls a `struct ConnectInfo` 494 * @param cls a `struct ConnectInfo`
495 * @param tc unused
496 */ 495 */
497static void 496static void
498offer_hello_done (void *cls, 497offer_hello_done (void *cls)
499 const struct GNUNET_SCHEDULER_TaskContext *tc)
500{ 498{
501 struct ConnectInfo *ci = cls; 499 struct ConnectInfo *ci = cls;
502 500
@@ -707,17 +705,17 @@ add_known_to_bloom (void *cls,
707 * and attempt to connect to them. 705 * and attempt to connect to them.
708 * 706 *
709 * @param cls closure for this task 707 * @param cls closure for this task
710 * @param tc the context under which the task is running
711 */ 708 */
712static void 709static void
713send_find_peer_message (void *cls, 710send_find_peer_message (void *cls)
714 const struct GNUNET_SCHEDULER_TaskContext *tc)
715{ 711{
716 struct GNUNET_TIME_Relative next_send_time; 712 struct GNUNET_TIME_Relative next_send_time;
717 struct BloomConstructorContext bcc; 713 struct BloomConstructorContext bcc;
718 struct GNUNET_CONTAINER_BloomFilter *peer_bf; 714 struct GNUNET_CONTAINER_BloomFilter *peer_bf;
715 const struct GNUNET_SCHEDULER_TaskContext *tc;
719 716
720 find_peer_task = NULL; 717 find_peer_task = NULL;
718 tc = GNUNET_SCHEDULER_get_task_context ();
721 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 719 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
722 return; 720 return;
723 if (newly_found_peers > bucket_size) 721 if (newly_found_peers > bucket_size)