From 4f47b28bace8908afbd9d2b5d4093005931d298d Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 6 Oct 2015 14:14:15 +0000 Subject: [PATCH] - ignore confirmation of connections that are being destroyed (tunnel shutting down, for instance) --- src/cadet/gnunet-service-cadet_connection.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 8b7ff9d8b..b6a03c2ad 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -460,6 +460,12 @@ connection_get (const struct GNUNET_CADET_Hash *cid) } +/** + * Change the connection state. Cannot change a connection marked as destroyed. + * + * @param c Connection to change. + * @param state New state to set. + */ static void connection_change_state (struct CadetConnection* c, enum CadetConnectionState state) @@ -2135,6 +2141,16 @@ GCC_handle_confirm (void *cls, return GNUNET_OK; } + if (GNUNET_NO != c->destroy) + { + GNUNET_assert (CADET_CONNECTION_DESTROYED != c->state); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "connection %s being destroyed, ignoring confirm\n", + GCC_2s (c)); + GCC_check_connections (); + return GNUNET_OK; + } + oldstate = c->state; LOG (GNUNET_ERROR_TYPE_DEBUG, " via peer %s\n", GNUNET_i2s (peer)); pi = GCP_get (peer, GNUNET_YES); -- 2.25.1