From 764e5405959a0ad0f9f1438087b7011b733ed352 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Feb 2010 22:28:48 +0000 Subject: [PATCH] fixing bad assumptions --- src/core/gnunet-service-core.c | 8 +++----- src/transport/gnunet-service-transport.c | 11 ----------- src/transport/transport_api.c | 7 +++---- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index ff71eddd3..4d7a21efe 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -2976,11 +2976,9 @@ handle_transport_receive (void *cls, #endif n = find_neighbour (peer); if (n == NULL) - { - GNUNET_break (0); - return; - } - GNUNET_break (n->is_connected); + n = create_neighbour (peer); + if (n == NULL) + return; n->last_latency = latency; n->last_distance = distance; up = (n->status == PEER_STATE_KEY_CONFIRMED); diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index f94ca3ef8..abeaaab68 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -2630,16 +2630,6 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, handle_pong(plugin, message, peer, sender_address, sender_address_len); break; default: - if (! n->received_pong) - { - GNUNET_break_op (0); -#if DEBUG_TRANSPORT || 1 - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Received message of type %u from `%4s', prior to key confirmation (dropped).\n", - ntohs (message->type), GNUNET_i2s (peer)); -#endif - break; - } #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s', sending to all clients.\n", @@ -2652,7 +2642,6 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, im->latency = GNUNET_TIME_relative_hton (n->latency); im->peer = *peer; memcpy (&im[1], message, msize); - cpos = clients; while (cpos != NULL) { diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 95e7a23fb..d95b94a7e 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -1528,10 +1528,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) #endif n = neighbour_find (h, &im->peer); if (n == NULL) - { - GNUNET_break (0); - break; - } + n = neighbour_add (h, &im->peer); + if (n == NULL) + break; if (h->rec != NULL) h->rec (h->cls, &im->peer, imm, GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance)); -- 2.25.1