From af40dca44fdc17cf8e4f3486b411b2da0d9d5462 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 24 Nov 2011 10:23:14 +0000 Subject: [PATCH] prevent same message from being requested twice by always skipping head-of-queue when inserting (possibly related to 1957) --- src/core/core_api.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/core/core_api.c b/src/core/core_api.c index 09a5c54a8..a279874d7 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -1423,15 +1423,12 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, GNUNET_free (minp); } - /* Order entries by deadline, but SKIP 'HEAD' if - * we're in the 'ready_peer_*' DLL */ + /* Order entries by deadline, but SKIP 'HEAD' (as we may have transmitted + that request already or might even already be approved to transmit that + message to core) */ pos = pr->pending_head; - if ((pr->prev != NULL) || (pr->next != NULL) || - (pr == handle->ready_peer_head)) - { - GNUNET_assert (pos != NULL); + if (pos != NULL) pos = pos->next; /* skip head */ - } /* insertion sort */ prev = pos; -- 2.25.1