From: Christian Grothoff Date: Tue, 14 Jul 2009 18:27:42 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~23696 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=20bc0ad630965adedb63c8eacf96a118f5d7ed0b;p=oweals%2Fgnunet.git fix --- diff --git a/TODO b/TODO index 5a8a6f23c..462690a9b 100644 --- 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] diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index ce0b03aad..f0fff02a7 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -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, diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 80c1c04d8..fb8cfe302 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -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 diff --git a/src/transport/test_transport_api_peer1.conf b/src/transport/test_transport_api_peer1.conf index 0ebda5786..13236fcef 100644 --- a/src/transport/test_transport_api_peer1.conf +++ b/src/transport/test_transport_api_peer1.conf @@ -8,7 +8,7 @@ PORT = 12364 [transport] PORT = 12365 PLUGINS = tcp -DEBUG = YES +#DEBUG = YES [arm] PORT = 12366 diff --git a/src/transport/test_transport_api_peer2.conf b/src/transport/test_transport_api_peer2.conf index d7efd6517..c30f2afb2 100644 --- a/src/transport/test_transport_api_peer2.conf +++ b/src/transport/test_transport_api_peer2.conf @@ -8,7 +8,7 @@ PORT = 22364 [transport] PORT = 22365 PLUGINS = tcp -DEBUG = YES +#DEBUG = YES [arm] PORT = 22366 diff --git a/src/transport/transport.h b/src/transport/transport.h index 35e48da2e..13dcbb6b8 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -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 diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 73d1ebac9..239983983 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -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);