summaryrefslogtreecommitdiffstats
path: root/src/queue.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:18:07 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:18:07 +0200
commit4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b (patch)
tree05396b7c13482ab27beb4593236b260c4bdf06c3 /src/queue.c
parentf25c92359e57b1e97c86174067485acf6a9445de (diff)
downloadfastd-4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b.tar
fastd-4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b.zip
Trigger handshake when unexpected data is received from a floating peer
Diffstat (limited to 'src/queue.c')
-rw-r--r--src/queue.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/queue.c b/src/queue.c
index 2509538..70ee54b 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -85,3 +85,13 @@ void fastd_queue_filter(fastd_context *ctx, fastd_queue *queue, bool (*pred)(fas
entry = &(*entry)->next;
}
}
+
+bool fastd_queue_has_entry(fastd_context *ctx, fastd_queue *queue, bool (*pred)(fastd_queue_entry*, void*), void *extra) {
+ fastd_queue_entry *entry;
+ for (entry = queue->head; entry; entry = entry->next) {
+ if (pred(entry, extra))
+ return true;
+ }
+
+ return false;
+}