fix
authorChristian Grothoff <christian@grothoff.org>
Tue, 14 Jul 2009 18:27:42 +0000 (18:27 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 14 Jul 2009 18:27:42 +0000 (18:27 +0000)
TODO
src/transport/gnunet-service-transport.c
src/transport/test_transport_api.c
src/transport/test_transport_api_peer1.conf
src/transport/test_transport_api_peer2.conf
src/transport/transport.h
src/transport/transport_api.c

diff --git a/TODO b/TODO
index 5a8a6f23c24cc8e1a5f80d78404861eae58ce16e..462690a9b48fc3c229e8efbcbac43da13420468e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,18 +1,5 @@
 PHASE #1: (Goal: settle key design questions)
 
-TRANSPORT:
-* testcase fails the first time when run with fresh /tmp
-  1) CONNECT fails because no validated HELLO is available
-     (actual validations are scheduled a few cycles later)
-  2) client waits for SEND_OK, which never comes (due to
-     CONNECT request failing; TCP signals error, but
-     "transmit_send_continuation" in gnunet-service-transport.c
-     does not (and currently has no way to) signal this to
-     the test-process => test-process eventually times out with
-     fatal error
-  3) in the meantime, gnunet-service-transport validates the
-     HELLOs => testcase passes next time...
-
 Util:
 * improve disk API [Nils] (Nils, is this done? -Christian)
 * Windows: use events instead of pipes to signal select()s [Nils]
index ce0b03aada944705a673c53991d4bead3dd0c4c7..f0fff02a7e4ba7b38215d69646fd39c3f2a1aedb 100644 (file)
@@ -2183,7 +2183,8 @@ handle_start (void *cls,
     {
 #if DEBUG_TRANSPORT
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Sending our own HELLO to new client\n");
+                  "Sending our own `%s' to new client\n",
+                 "HELLO");
 #endif
       transmit_to_client (c,
                           (const struct GNUNET_MessageHeader *) our_hello,
index 80c1c04d8fe7d7181d62e1cfc4a44f14c3337569..fb8cfe302d636af2a20a219b9bb3fc2c94125bc5 100644 (file)
@@ -31,7 +31,7 @@
 #include "gnunet_transport_service.h"
 #include "transport.h"
 
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 #define START_ARM GNUNET_YES
 
index 0ebda5786242aa3c952456257b97b89732a5c03c..13236fcef8c0cedec9db48ae47610d3aec547550 100644 (file)
@@ -8,7 +8,7 @@ PORT = 12364
 [transport]
 PORT = 12365
 PLUGINS = tcp
-DEBUG = YES
+#DEBUG = YES
 
 [arm]
 PORT = 12366
index d7efd65170050ed9fb693ed7605e8e209d6c5f8e..c30f2afb2687b10ab3f4955f96ef35893cc6f654 100644 (file)
@@ -8,7 +8,7 @@ PORT = 22364
 [transport]
 PORT = 22365
 PLUGINS = tcp
-DEBUG = YES
+#DEBUG = YES
 
 [arm]
 PORT = 22366
index 35e48da2e1869272b483f191e56275209d2fb05f..13dcbb6b8563c7fdac1be6409f9bd2e743fdfa38 100644 (file)
@@ -27,7 +27,7 @@
 #include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
 
-#define DEBUG_TRANSPORT GNUNET_YES
+#define DEBUG_TRANSPORT GNUNET_NO
 
 /**
  * For how long do we allow unused bandwidth
index 73d1ebac9ed5a7506eb5dfa1c4ebc41724973c84..239983983075bc6829192f015be9e005d4985f46 100644 (file)
@@ -80,7 +80,6 @@ struct NeighbourList
    */
   struct GNUNET_TRANSPORT_TransmitHandle *transmit_handle;
 
-
   /**
    * Identity of this neighbour.
    */
@@ -1034,13 +1033,7 @@ try_connect_task (void *cls,
 {
   struct GNUNET_TRANSPORT_TransmitHandle *th = cls;  
 
-  th->notify_delay_task
-    = GNUNET_SCHEDULER_add_delayed (th->handle->sched,
-                                   GNUNET_NO,
-                                   GNUNET_SCHEDULER_PRIORITY_KEEP,
-                                   GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                                   GNUNET_TIME_absolute_get_remaining
-                                   (th->timeout), &transmit_timeout, th);
+  th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK;
   try_connect (th);
 }
 
@@ -1085,18 +1078,16 @@ remove_neighbour (struct GNUNET_TRANSPORT_Handle *h,
       pos->transmit_handle = NULL;
       th->neighbour = NULL;
       remove_from_any_list (th);
-      if (GNUNET_TIME_absolute_get_remaining (th->timeout).value > CONNECT_RETRY_TIMEOUT.value)
+      if (GNUNET_TIME_absolute_get_remaining (th->timeout).value <= CONNECT_RETRY_TIMEOUT.value)
        {
          /* signal error */
-         GNUNET_SCHEDULER_cancel (h->sched,
-                                  th->notify_delay_task);
+         GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task);
          transmit_timeout (th, NULL);    
        }
       else
        {
          /* try again in a bit */
-         GNUNET_SCHEDULER_cancel (h->sched,
-                                  th->notify_delay_task);
+         GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task);
          th->notify_delay_task 
            = GNUNET_SCHEDULER_add_delayed (h->sched,
                                            GNUNET_NO,
@@ -1665,8 +1656,6 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
                   "Receiving `%s' message, transmission %s.\n", "SEND_OK",
                  ntohl(okm->success) == GNUNET_OK ? "succeeded" : "failed");
 #endif
-      /* FIXME: need to check status code and change action accordingly,
-        especially if the error was for CONNECT */
       n = find_neighbour (h, &okm->peer);
       GNUNET_assert (n != NULL);
       n->transmit_ok = GNUNET_YES;
@@ -1674,7 +1663,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
         {
 #if DEBUG_TRANSPORT
           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                      "Processing pending message\n");
+                      "Processing pending message for `%4s'\n",
+                     GNUNET_i2s(&n->id));
 #endif
           GNUNET_SCHEDULER_cancel (h->sched,
                                    n->transmit_handle->notify_delay_task);