gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 04/04: Fix channel disconnect checking<


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 04/04: Fix channel disconnect checking<
Date: Tue, 21 Feb 2017 13:49:35 +0100

This is an automated email from the git hooks/post-receive script.

bart-polot pushed a commit to branch master
in repository gnunet.

commit 40537b04870c1fb34a231f85666ca39a6e4a6cbe
Author: Bart Polot <address@hidden>
AuthorDate: Tue Feb 21 13:48:00 2017 +0100

    Fix channel disconnect checking<
---
 src/cadet/test_cadet_new.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/cadet/test_cadet_new.c b/src/cadet/test_cadet_new.c
index 622e87ea1..d32404815 100644
--- a/src/cadet/test_cadet_new.c
+++ b/src/cadet/test_cadet_new.c
@@ -729,33 +729,32 @@ connect_handler (void *cls, struct GNUNET_CADET_Channel 
*channel,
  * It should clean up any associated state, including cancelling any pending
  * transmission on this channel.
  *
- * @param cls Channel closure.
+ * @param cls Channel closure (channel wrapper).
  * @param channel Connection to the other end (henceforth invalid).
  */
 static void
 disconnect_handler (void *cls, const struct GNUNET_CADET_Channel *channel)
 {
-  long i = (long) cls;
+  struct CadetTestChannelWrapper *ch_w = cls;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Channel disconnected at %p\n", cls);
-  if (peers_running - 1 == i)
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Channel disconnected\n");
+  GNUNET_assert (ch_w->ch == channel);
+  if (channel == incoming_ch)
   {
     ok++;
-    GNUNET_break (channel == incoming_ch);
     incoming_ch = NULL;
   }
-  else if (0L == i)
+  else if (outgoing_ch == channel
+  )
   {
     if (P2P_SIGNAL == test)
     {
       ok++;
     }
-    GNUNET_break (channel == outgoing_ch);
     outgoing_ch = NULL;
   }
   else
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unknown peer! %d\n", (int) i);
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unknown channel! %p\n", channel);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
 
   if (NULL != disconnect_task)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]