stuff
[oweals/gnunet.git] / src / transport / test_quota_compliance.c
index 2857a30570da54c11ceb78ce0b2e28c3e70022ac..921fa954218d4590a26afd00d01e4b936d60afb1 100644 (file)
@@ -615,8 +615,11 @@ notify_connect (void *cls,
     }
   if (connected == 2)
     {
-      GNUNET_SCHEDULER_cancel (tct);
-      tct = GNUNET_SCHEDULER_NO_TASK;
+      if (GNUNET_SCHEDULER_NO_TASK != tct)
+       {
+         GNUNET_SCHEDULER_cancel (tct);
+         tct = GNUNET_SCHEDULER_NO_TASK;
+       }
       GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2);
       GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
       if (is_asymmetric_send_constant == GNUNET_YES)
@@ -632,6 +635,14 @@ notify_connect (void *cls,
 static void
 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
 {
+  if (cls == &p2)
+    {
+      if (NULL != transmit_handle)
+       {
+         GNUNET_TRANSPORT_notify_transmit_ready_cancel (transmit_handle);
+         transmit_handle = NULL;
+       }
+    }
   connected--;
 #if DEBUG_CONNECTIONS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,