aboutsummaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index e0d7c9f34..95bcd71cb 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -377,6 +377,28 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
377 377
378 378
379/** 379/**
380 * Remove the first envelope that has not yet been sent from the message
381 * queue and return it.
382 *
383 * @param mq queue to remove envelope from
384 * @return NULL if queue is empty (or has no envelope that is not under transmission)
385 */
386struct GNUNET_MQ_Envelope *
387GNUNET_MQ_unsent_head (struct GNUNET_MQ_Handle *mq)
388{
389 struct GNUNET_MQ_Envelope *env;
390
391 env = mq->envelope_head;
392 GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
393 mq->envelope_tail,
394 env);
395 mq->queue_length--;
396 env->parent_queue = NULL;
397 return env;
398}
399
400
401/**
380 * Function to copy an envelope. The envelope must not yet 402 * Function to copy an envelope. The envelope must not yet
381 * be in any queue or have any options or callbacks set. 403 * be in any queue or have any options or callbacks set.
382 * 404 *