From 3943da8a6cdb1f8f67b6f66e7911620e6ecdbe41 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Thu, 4 Feb 2010 11:15:11 +0000 Subject: [PATCH] received ack removal --- src/transport/gnunet-service-transport.c | 9 +++++++ src/transport/transport_api.c | 34 ++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index f43094499..e0802c758 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -2186,6 +2186,15 @@ process_hello (struct TransportPlugin *plugin, "Processing `%s' message for `%4s' of size %d (hsize is %d)\n", "HELLO", GNUNET_i2s (&target), GNUNET_HELLO_size(hello), hsize); #endif + +#if DEBUG_TRANSPORT + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Notifying peerinfo about peer %s\n", + GNUNET_i2s (&target)); +#endif + /* For some reason the line below causes something to hang up... maybe peerinfo isn't ready yet? */ + /*GNUNET_PEERINFO_add_peer (cfg, sched, &target, hello); */ + /* check if a HELLO for this peer is already on the validation list */ e = pending_validations; while (e != NULL) diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 347842e52..8b4fe3ffd 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -104,6 +104,7 @@ struct NeighbourList */ int transmit_ok; +#if ACK /** * Set to GNUNET_YES if we have received an ACK for the * given peer. Peers that receive our HELLO always respond @@ -114,7 +115,7 @@ struct NeighbourList * transport API itself). */ int received_ack; - +#endif }; @@ -1639,7 +1640,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Do know neighbor, scheduling transmission!\n"); #endif +#if ACK n->received_ack = GNUNET_YES; +#endif if (NULL != n->transmit_handle) { #if DEBUG_TRANSPORT @@ -1736,7 +1739,6 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) GNUNET_SCHEDULER_cancel (h->sched, n->transmit_handle->notify_delay_task); n->transmit_handle->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; - GNUNET_assert (GNUNET_YES == n->received_ack); schedule_request (n->transmit_handle); } break; @@ -1767,31 +1769,29 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) "Receiving `%s' message from `%4s'.\n", "ACK", GNUNET_i2s (&im->peer)); #endif + break; + default: +#if DEBUG_TRANSPORT + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Received message of type %u from `%4s'.\n", + ntohs (imm->type), GNUNET_i2s (&im->peer)); +#endif + n = find_neighbour (h, &im->peer); if (n == NULL) { GNUNET_break (0); break; } - if (n->received_ack == GNUNET_NO) + + if (NULL != n->transmit_handle) { - n->received_ack = GNUNET_YES; - if (NULL != n->transmit_handle) - { #if DEBUG_TRANSPORT - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Peer connected, scheduling delayed message for delivery now.\n"); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Peer connected, scheduling delayed message for delivery now.\n"); #endif - schedule_request (n->transmit_handle); - } + schedule_request (n->transmit_handle); } - break; - default: -#if DEBUG_TRANSPORT - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Received message of type %u from `%4s'.\n", - ntohs (imm->type), GNUNET_i2s (&im->peer)); -#endif if (h->rec != NULL) h->rec (h->cls, &im->peer, imm, GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance)); -- 2.25.1