From fd057b7cf6c72ce512dab9d6f3d47f052053df83 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 17 Jun 2015 09:29:07 +0000 Subject: [PATCH] - don't invalidate direct connections unless peer disconnects on core level --- src/cadet/cadet_path.c | 2 +- src/cadet/gnunet-service-cadet_connection.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c index 16e55aa0f..1118f0e22 100644 --- a/src/cadet/cadet_path.c +++ b/src/cadet/cadet_path.c @@ -77,7 +77,7 @@ path_new (unsigned int length) p->length = length; p->peers = GNUNET_malloc (length * sizeof (GNUNET_PEER_Id)); } - LOG (GNUNET_ERROR_TYPE_INFO, "New path %p (%u)\n", path, path->length); + LOG (GNUNET_ERROR_TYPE_INFO, "New path %p (%u)\n", p, p->length); return p; } diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 4791e6d03..c5ef4c732 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -2061,7 +2061,8 @@ GCC_handle_broken (void* cls, return GNUNET_OK; } endpoint = GCP_get_short (c->path->peers[c->path->length - 1]); - path_invalidate (c->path); + if (2 < c->path->length) + path_invalidate (c->path); GCP_notify_broken_link (endpoint, &msg->peer1, &msg->peer2); c->state = CADET_CONNECTION_BROKEN; -- 2.25.1