diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-07-15 11:45:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-07-15 11:45:50 +0000 |
commit | 28b916f7e44f3ddce47326fc8c534beb7d9ebd1e (patch) | |
tree | a4b2cc564d0e030de7b80353d387a96ebfeb6fc6 /src | |
parent | d4e24e19deceae28e8d2f2f8cf5e6b3e8813447d (diff) | |
download | gnunet-28b916f7e44f3ddce47326fc8c534beb7d9ebd1e.tar.gz gnunet-28b916f7e44f3ddce47326fc8c534beb7d9ebd1e.zip |
-need to fully unregister from neighbours, as otherwise assertion fails if identical connection is added
Diffstat (limited to 'src')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index cd36cf1af..7c5fb5507 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -1694,9 +1694,15 @@ unregister_neighbors (struct CadetConnection *c) | |||
1694 | if (NULL == c->path) | 1694 | if (NULL == c->path) |
1695 | return; | 1695 | return; |
1696 | if (NULL != c->next_peer) | 1696 | if (NULL != c->next_peer) |
1697 | { | ||
1697 | GCP_remove_connection (c->next_peer, c); | 1698 | GCP_remove_connection (c->next_peer, c); |
1699 | c->next_peer = NULL; | ||
1700 | } | ||
1698 | if (NULL != c->prev_peer) | 1701 | if (NULL != c->prev_peer) |
1702 | { | ||
1699 | GCP_remove_connection (c->prev_peer, c); | 1703 | GCP_remove_connection (c->prev_peer, c); |
1704 | c->prev_peer = NULL; | ||
1705 | } | ||
1700 | } | 1706 | } |
1701 | 1707 | ||
1702 | 1708 | ||
@@ -3266,16 +3272,7 @@ GCC_notify_broken (struct CadetConnection *c, | |||
3266 | c)); | 3272 | c)); |
3267 | /* Cancel queue in the direction that just died. */ | 3273 | /* Cancel queue in the direction that just died. */ |
3268 | connection_cancel_queues (c, ! fwd); | 3274 | connection_cancel_queues (c, ! fwd); |
3269 | if (fwd) | 3275 | unregister_neighbors (c); |
3270 | { | ||
3271 | GCP_remove_connection (c->prev_peer, c); | ||
3272 | c->prev_peer = NULL; | ||
3273 | } | ||
3274 | else | ||
3275 | { | ||
3276 | GCP_remove_connection (c->next_peer, c); | ||
3277 | c->next_peer = NULL; | ||
3278 | } | ||
3279 | GNUNET_assert (NULL != ( (fwd) ? c->next_peer : c->prev_peer) ); | 3276 | GNUNET_assert (NULL != ( (fwd) ? c->next_peer : c->prev_peer) ); |
3280 | GCC_check_connections (); | 3277 | GCC_check_connections (); |
3281 | } | 3278 | } |