aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cadet/test_cadet_new.c17
1 files 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,
729 * It should clean up any associated state, including cancelling any pending 729 * It should clean up any associated state, including cancelling any pending
730 * transmission on this channel. 730 * transmission on this channel.
731 * 731 *
732 * @param cls Channel closure. 732 * @param cls Channel closure (channel wrapper).
733 * @param channel Connection to the other end (henceforth invalid). 733 * @param channel Connection to the other end (henceforth invalid).
734 */ 734 */
735static void 735static void
736disconnect_handler (void *cls, const struct GNUNET_CADET_Channel *channel) 736disconnect_handler (void *cls, const struct GNUNET_CADET_Channel *channel)
737{ 737{
738 long i = (long) cls; 738 struct CadetTestChannelWrapper *ch_w = cls;
739 739
740 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 740 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Channel disconnected\n");
741 "Channel disconnected at %p\n", cls); 741 GNUNET_assert (ch_w->ch == channel);
742 if (peers_running - 1 == i) 742 if (channel == incoming_ch)
743 { 743 {
744 ok++; 744 ok++;
745 GNUNET_break (channel == incoming_ch);
746 incoming_ch = NULL; 745 incoming_ch = NULL;
747 } 746 }
748 else if (0L == i) 747 else if (outgoing_ch == channel
748 )
749 { 749 {
750 if (P2P_SIGNAL == test) 750 if (P2P_SIGNAL == test)
751 { 751 {
752 ok++; 752 ok++;
753 } 753 }
754 GNUNET_break (channel == outgoing_ch);
755 outgoing_ch = NULL; 754 outgoing_ch = NULL;
756 } 755 }
757 else 756 else
758 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unknown peer! %d\n", (int) i); 757 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unknown channel! %p\n", channel);
759 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); 758 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
760 759
761 if (NULL != disconnect_task) 760 if (NULL != disconnect_task)