diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-06-25 03:47:36 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-06-25 03:47:36 +0000 |
commit | 86ba6d5b16f7741768e801ea11bbdc492a1ceeb6 (patch) | |
tree | c76f34c64264cfc312526a484f1c0274f7f78a32 | |
parent | f4f0fc75d3b88b492deab41df0a9a3bc7902027c (diff) | |
download | gnunet-86ba6d5b16f7741768e801ea11bbdc492a1ceeb6.tar.gz gnunet-86ba6d5b16f7741768e801ea11bbdc492a1ceeb6.zip |
- don't try to retrive a peer during a shutdown task
-rw-r--r-- | src/cadet/cadet_path.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c index 1118f0e22..fc9f9c453 100644 --- a/src/cadet/cadet_path.c +++ b/src/cadet/cadet_path.c | |||
@@ -48,12 +48,14 @@ path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
48 | struct CadetPeer *peer; | 48 | struct CadetPeer *peer; |
49 | 49 | ||
50 | LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length); | 50 | LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length); |
51 | if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) | ||
52 | return; | ||
53 | path->path_delete = NULL; | 51 | path->path_delete = NULL; |
54 | peer = GCP_get_short (path->peers[path->length - 1]); | 52 | |
55 | if (2 < path->length) | 53 | if (2 < path->length && (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0) |
54 | { | ||
55 | /* During shutdown, the peers peermap might not exist anymore. */ | ||
56 | peer = GCP_get_short (path->peers[path->length - 1]); | ||
56 | GCP_remove_path (peer, path); | 57 | GCP_remove_path (peer, path); |
58 | } | ||
57 | else | 59 | else |
58 | path_destroy (path); | 60 | path_destroy (path); |
59 | } | 61 | } |