From 0e62c9501710428cc6e27dded5262e2999b7fe56 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 5 Mar 2013 13:39:28 +0000 Subject: - dont offer hellos if not going to use them --- src/dht/gnunet-service-dht_neighbours.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/dht') diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 79f3e64a3..f0e18f48f 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -1975,17 +1975,16 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_break_op (0); return GNUNET_YES; } - if (0 != memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity))) + if ((GNUNET_YES != disable_try_connect) && + 0 != memcmp (&my_identity, &pid, sizeof (struct GNUNET_PeerIdentity))) { bucket = find_bucket (&pid.hashPubKey); - if ((bucket >= 0) && (k_buckets[bucket].peers_size < bucket_size)) + if ((bucket >= 0) && + (k_buckets[bucket].peers_size < bucket_size) && + (NULL != GDS_transport_handle)) { - if (NULL != GDS_transport_handle) - { - GNUNET_TRANSPORT_offer_hello (GDS_transport_handle, h, NULL, NULL); - if (GNUNET_YES != disable_try_connect) - GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid, NULL, NULL); /*FIXME TRY_CONNECT change */ - } + GNUNET_TRANSPORT_offer_hello (GDS_transport_handle, h, NULL, NULL); + GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid, NULL, NULL); /*FIXME TRY_CONNECT change */ } } } -- cgit v1.2.3