diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-17 15:25:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-17 15:25:59 +0000 |
commit | b90fdb9329d445cb2829205cc134b06689f1fe7b (patch) | |
tree | c141275099044f92addf38d9acbfaf10f054373e | |
parent | 78e016de05856066aed6acf5cdc601145c236f3b (diff) | |
download | gnunet-b90fdb9329d445cb2829205cc134b06689f1fe7b.tar.gz gnunet-b90fdb9329d445cb2829205cc134b06689f1fe7b.zip |
cancel change preference request
-rw-r--r-- | src/dht/gnunet-service-dht.c | 7 |
1 files changed, 7 insertions, 0 deletions
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, | |||
1479 | uint64_t preference) | 1479 | uint64_t preference) |
1480 | { | 1480 | { |
1481 | struct PeerInfo *peer_info = cls; | 1481 | struct PeerInfo *peer_info = cls; |
1482 | |||
1482 | peer_info->info_ctx = NULL; | 1483 | peer_info->info_ctx = NULL; |
1483 | GNUNET_SCHEDULER_add_delayed (DHT_DEFAULT_PREFERENCE_INTERVAL, | 1484 | GNUNET_SCHEDULER_add_delayed (DHT_DEFAULT_PREFERENCE_INTERVAL, |
1484 | &update_core_preference, peer_info); | 1485 | &update_core_preference, peer_info); |
@@ -5263,6 +5264,7 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
5263 | GNUNET_CONTAINER_multihashmap_contains (all_known_peers, | 5264 | GNUNET_CONTAINER_multihashmap_contains (all_known_peers, |
5264 | &peer->hashPubKey)) | 5265 | &peer->hashPubKey)) |
5265 | { | 5266 | { |
5267 | GNUNET_break (0); | ||
5266 | #if DEBUG_DHT | 5268 | #if DEBUG_DHT |
5267 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5268 | "%s:%s: do not have peer `%s' in RT, can't disconnect!\n", | 5270 | "%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) | |||
5276 | to_remove = | 5278 | to_remove = |
5277 | GNUNET_CONTAINER_multihashmap_get (all_known_peers, &peer->hashPubKey); | 5279 | GNUNET_CONTAINER_multihashmap_get (all_known_peers, &peer->hashPubKey); |
5278 | GNUNET_assert (to_remove != NULL); | 5280 | GNUNET_assert (to_remove != NULL); |
5281 | if (NULL != to_remove->info_ctx) | ||
5282 | { | ||
5283 | GNUNET_CORE_peer_change_preference_cancel (to_remove->info_ctx); | ||
5284 | to_remove->info_ctx = NULL; | ||
5285 | } | ||
5279 | GNUNET_assert (0 == | 5286 | GNUNET_assert (0 == |
5280 | memcmp (peer, &to_remove->id, | 5287 | memcmp (peer, &to_remove->id, |
5281 | sizeof (struct GNUNET_PeerIdentity))); | 5288 | sizeof (struct GNUNET_PeerIdentity))); |