From 5cfa6bf5a9960c0deb302582037dadcaa8996575 Mon Sep 17 00:00:00 2001 From: Gabor X Toth <*@tg-x.net> Date: Fri, 19 Aug 2016 19:58:24 +0000 Subject: [PATCH] GNUNET_MQ_get_last_envelope: return tail or current --- src/util/mq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/mq.c b/src/util/mq.c index b971fdefd..b22d97f59 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -1096,7 +1096,10 @@ GNUNET_MQ_get_current_envelope (struct GNUNET_MQ_Handle *mq) struct GNUNET_MQ_Envelope * GNUNET_MQ_get_last_envelope (struct GNUNET_MQ_Handle *mq) { - return mq->envelope_tail; + if (NULL != mq->envelope_tail) + return mq->envelope_tail; + + return mq->current_envelope; } -- 2.25.1