fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 2 Oct 2009 13:40:59 +0000 (13:40 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 2 Oct 2009 13:40:59 +0000 (13:40 +0000)
src/transport/plugin_transport_tcp.c
src/transport/transport_api.c

index 15afeab3d0f921f186b3848115021c6e37508ad4..8e5f5dcef77bc7c32c0342c22c1a90392b9dca68 100644 (file)
@@ -39,7 +39,7 @@
 #include "plugin_transport.h"
 #include "transport.h"
 
-#define DEBUG_TCP GNUNET_YES
+#define DEBUG_TCP GNUNET_NO
 
 /**
  * After how long do we expire an address that we
index 49462fd5db79de9678e43a9f5d32fbfd22fd4844..367df658d8cd1fb7f976c4e348347f8c9acdbdd6 100644 (file)
@@ -381,6 +381,7 @@ transport_notify_ready (void *cls, size_t size, void *buf)
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                  "Could not transmit to transport service, cancelling pending requests\n");
 #endif
+      th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
       th = h->connect_ready_head;
       if (th->next != NULL)
         th->next->prev = NULL;
@@ -390,8 +391,12 @@ transport_notify_ready (void *cls, size_t size, void *buf)
           GNUNET_assert (n->transmit_handle == th);
           n->transmit_handle = NULL;
         }
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != th->notify_delay_task);
+      GNUNET_SCHEDULER_cancel (h->sched,
+                              th->notify_delay_task);
       GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
       GNUNET_free (th);
+      if (h->connect_ready_head != NULL) schedule_transmission (h); /* FIXME: is this ok? */
       return 0;
     } 
 #if DEBUG_TRANSPORT
@@ -990,6 +995,11 @@ request_connect (void *cls, size_t size, void *buf)
                  GNUNET_i2s(&th->target));
 #endif
       th->notify (th->notify_cls, 0, NULL);
+      if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
+       {
+         GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task);
+         th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
+       }
       GNUNET_free (th);
       return 0;
     }