From e7b2f86d362dca94c03b50e9a9f1ec9220de9b21 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Wed, 24 Feb 2021 11:25:28 +0100 Subject: -fix neighbour send --- src/transport/gnunet-service-tng.c | 18 +++++++++--------- src/transport/transport-testing2.c | 5 +++++ 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index bfa5ca772..a4c7f0517 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c @@ -4230,7 +4230,7 @@ route_via_neighbour (const struct Neighbour *n, for (struct Queue *pos = n->queue_head; NULL != pos; pos = pos->next_neighbour) { - if ((0 == (options & RMO_UNCONFIRMED_ALLOWED)) || + if ((0 != (options & RMO_UNCONFIRMED_ALLOWED)) || (pos->validated_until.abs_value_us > now.abs_value_us)) candidates++; } @@ -4259,7 +4259,7 @@ route_via_neighbour (const struct Neighbour *n, for (struct Queue *pos = n->queue_head; NULL != pos; pos = pos->next_neighbour) { - if ((0 == (options & RMO_UNCONFIRMED_ALLOWED)) || + if ((0 != (options & RMO_UNCONFIRMED_ALLOWED)) || (pos->validated_until.abs_value_us > now.abs_value_us)) { if ((sel1 == candidates) || (sel2 == candidates)) @@ -7696,8 +7696,6 @@ handle_hello_for_incoming (void *cls, } - - /** * Communicator gave us a transport address validation challenge. Process the * request. @@ -7761,12 +7759,15 @@ handle_validation_challenge ( route_control_message_without_fc (&cmc->im.sender, &tvr.header, RMO_ANYTHING_GOES | RMO_REDUNDANT); - } else { + } + else + { /* Use route via neighbour */ n = lookup_neighbour (&sender); if (NULL != n) route_via_neighbour (n, &tvr.header, - RMO_ANYTHING_GOES | RMO_REDUNDANT); + RMO_ANYTHING_GOES | RMO_REDUNDANT + | RMO_UNCONFIRMED_ALLOWED); } finish_cmc_handling (cmc); @@ -8992,8 +8993,8 @@ handle_send_message_ack (void *cls, if (0 != GNUNET_memcmp (&queue->neighbour->pid, &sma->receiver)) continue; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Found PID %s\n", - GNUNET_i2s (&queue->neighbour->pid)); + "Found PID %s\n", + GNUNET_i2s (&queue->neighbour->pid)); for (struct QueueEntry *qep = queue->queue_head; NULL != qep; @@ -9667,7 +9668,6 @@ handle_update_queue_message (void *cls, } - /** * Communicator tells us that our request to create a queue "worked", that * is setting up the queue is now in process. diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c index 23173e763..513b030b8 100644 --- a/src/transport/transport-testing2.c +++ b/src/transport/transport-testing2.c @@ -696,6 +696,11 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_ATS_connectivity_done (p->ats); p->ats = NULL; } + if (NULL != p->ph) + { + GNUNET_PEERSTORE_disconnect (p->ph, GNUNET_NO); + p->ph = NULL; + } if (NULL != p->hello) { GNUNET_free (p->hello); -- cgit v1.2.3