From b90fdb9329d445cb2829205cc134b06689f1fe7b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Jun 2011 15:25:59 +0000 Subject: cancel change preference request --- src/dht/gnunet-service-dht.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 44b39c90e..61044549b 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -1479,6 +1479,7 @@ update_core_preference_finish (void *cls, uint64_t preference) { struct PeerInfo *peer_info = cls; + peer_info->info_ctx = NULL; GNUNET_SCHEDULER_add_delayed (DHT_DEFAULT_PREFERENCE_INTERVAL, &update_core_preference, peer_info); @@ -5263,6 +5264,7 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) GNUNET_CONTAINER_multihashmap_contains (all_known_peers, &peer->hashPubKey)) { + GNUNET_break (0); #if DEBUG_DHT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s:%s: do not have peer `%s' in RT, can't disconnect!\n", @@ -5276,6 +5278,11 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) to_remove = GNUNET_CONTAINER_multihashmap_get (all_known_peers, &peer->hashPubKey); GNUNET_assert (to_remove != NULL); + if (NULL != to_remove->info_ctx) + { + GNUNET_CORE_peer_change_preference_cancel (to_remove->info_ctx); + to_remove->info_ctx = NULL; + } GNUNET_assert (0 == memcmp (peer, &to_remove->id, sizeof (struct GNUNET_PeerIdentity))); -- cgit v1.2.3