aboutsummaryrefslogtreecommitdiffstats
path: root/libosmocore/src/write_queue.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-06 21:49:41 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-06 21:51:26 +0200
commit9960d59fffa176ab022c9641c7358030d7f8065c (patch)
tree18573b4edf3eb496307d4b33d99ca031c98c3981 /libosmocore/src/write_queue.c
parent161bd6d253abeef6b181dbe9fdd245bd7c9884af (diff)
parent3c71232b112a40bf09bd9687f1bc6aed12e863a3 (diff)
Merge remote branch 'origin/master' into on-waves/bsc-master
* Move to the new log code and update binaries * Catch up with lchan changes from master Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/src/Makefile.am openbsc/src/bsc_rll.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_04_08.c openbsc/src/gsm_04_11.c openbsc/src/gsm_subscriber_base.c openbsc/src/handover_logic.c openbsc/src/silent_call.c openbsc/src/transaction.c openbsc/src/vty_interface.c openbsc/src/vty_interface_cmds.c
Diffstat (limited to 'libosmocore/src/write_queue.c')
-rw-r--r--libosmocore/src/write_queue.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libosmocore/src/write_queue.c b/libosmocore/src/write_queue.c
index 7d908b4ca..a0ac2d6fd 100644
--- a/libosmocore/src/write_queue.c
+++ b/libosmocore/src/write_queue.c
@@ -72,3 +72,14 @@ int write_queue_enqueue(struct write_queue *queue, struct msgb *data)
return 0;
}
+
+void write_queue_clear(struct write_queue *queue)
+{
+ while (!llist_empty(&queue->msg_queue)) {
+ struct msgb *msg = msgb_dequeue(&queue->msg_queue);
+ msgb_free(msg);
+ }
+
+ queue->current_length = 0;
+ queue->bfd.when &= ~BSC_FD_WRITE;
+}