fixing assertion transport_api_new.c:379
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 20 Jun 2011 11:44:11 +0000 (11:44 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 20 Jun 2011 11:44:11 +0000 (11:44 +0000)
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_unreliability.c

index 4af8a24f98c2bca668436943aaae524bab36dac1..7fc9d43b4e7eb0637f5ed9ef15efa633dae1063d 100644 (file)
@@ -333,7 +333,8 @@ notify_ready (void *cls, size_t size, void *buf)
   while (size - ret >= s);
   if (n < TOTAL_MSGS)
   {
-    th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+    if (th_p2 == NULL)
+      th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
                                            &p1.id,
                                            s, 0, TIMEOUT,
                                            &notify_ready,
@@ -360,6 +361,8 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
               "Peer `%4s' disconnected (%p)!\n",
              GNUNET_i2s (peer), cls);
 #endif
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
 }
 
 
index b717cb8a0b8a3c19e874e67c488693ed7414c180..a482edda0d7217ee3f2597cd9c16f578cfad7be1 100644 (file)
@@ -457,6 +457,8 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
               "Peer `%4s' disconnected (%p)!\n",
              GNUNET_i2s (peer), cls);
 #endif
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
 }