From e51f1f9733ddc294bffb50fc29f25dcdebf44d6d Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Mon, 1 Feb 2010 10:27:55 +0000 Subject: Simplified handling of connection pending queue. Moved some of the complexity into functions in bgp_connection, so that "do" functions in bgp_session have to deal with less of the mechanics. modified: bgpd/bgp_connection.c modified: bgpd/bgp_connection.h modified: bgpd/bgp_session.c modified: bgpd/bgp_session.h modified: lib/mqueue.c modified: lib/mqueue.h --- lib/mqueue.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/mqueue.c') diff --git a/lib/mqueue.c b/lib/mqueue.c index 7156e31e..de1d654c 100644 --- a/lib/mqueue.c +++ b/lib/mqueue.c @@ -708,7 +708,7 @@ mqueue_done_waiting(mqueue_queue mq, mqueue_thread_signal mtsig) } ; /*------------------------------------------------------------------------------ - * Enqueue message on local queue + * Enqueue message on local queue -- at tail */ extern void mqueue_local_enqueue(mqueue_local_queue lmq, mqueue_block mqb) @@ -721,6 +721,19 @@ mqueue_local_enqueue(mqueue_local_queue lmq, mqueue_block mqb) mqb->next = NULL ; } ; +/*------------------------------------------------------------------------------ + * Enqueue message on local queue -- at head + */ +extern void +mqueue_local_enqueue_head(mqueue_local_queue lmq, mqueue_block mqb) +{ + if (lmq->head == NULL) + lmq->tail = mqb ; + + mqb->next = lmq->head ; + lmq->head = mqb ; +} ; + /*------------------------------------------------------------------------------ * Dequeue message from local queue -- returns NULL if empty */ -- cgit v1.2.3