summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/write_queue.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/write_queue.c b/src/write_queue.c
index 7d908b4c..a0ac2d6f 100644
--- a/src/write_queue.c
+++ b/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;
+}