From 5e6a45f88f934e01e25c4042ada3ec7964572e8f Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 21 Jul 2014 00:15:19 +0000 Subject: [PATCH] - as connecton_pop destroys many message type wihtout return, count is not applicable --- src/cadet/gnunet-service-cadet_connection.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 102f7edac..604b9ad4d 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -1818,7 +1818,6 @@ GCC_handle_broken (void* cls, struct GNUNET_MessageHeader *out_msg; struct CadetPeer *neighbor; struct CadetPeer *endpoint; - int pending_msgs; if (NULL == t) { @@ -1833,25 +1832,15 @@ GCC_handle_broken (void* cls, c->state = CADET_CONNECTION_DESTROYED; GCT_remove_connection (t, c); c->t = NULL; - pending_msgs = c->pending_messages; /* GCP_connection_pop will destroy the connection when the last message * is popped! Do not use 'c' after the call. */ while (NULL != (out_msg = GCP_connection_pop (neighbor, c))) { GCT_resend_message (out_msg, t); - pending_msgs--; } - - /* All pending messages should have been popped and the connection - * destroyed. If not, destroy the connection anyway! */ - if (0 < pending_msgs) - { - GNUNET_break (0); - GCC_destroy (c); - } - else - GNUNET_break (0 == pending_msgs); /* Counter error! */ + /* All pending messages should have been popped, + * and the connection destroyed by the continuation. */ } else { -- 2.25.1