diff options
Diffstat (limited to 'usr.sbin/smtpd/scheduler_ramqueue.c')
-rw-r--r-- | usr.sbin/smtpd/scheduler_ramqueue.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/scheduler_ramqueue.c b/usr.sbin/smtpd/scheduler_ramqueue.c index 9ff16f16afd..d8d7c05ed8f 100644 --- a/usr.sbin/smtpd/scheduler_ramqueue.c +++ b/usr.sbin/smtpd/scheduler_ramqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scheduler_ramqueue.c,v 1.41 2015/01/20 17:37:54 deraadt Exp $ */ +/* $OpenBSD: scheduler_ramqueue.c,v 1.42 2015/10/29 10:25:36 sunil Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -114,6 +114,7 @@ static int scheduler_ram_schedule(uint64_t); static int scheduler_ram_remove(uint64_t); static int scheduler_ram_suspend(uint64_t); static int scheduler_ram_resume(uint64_t); +static int scheduler_ram_query(uint64_t); static void sorted_insert(struct rq_queue *, struct rq_envelope *); @@ -149,6 +150,7 @@ struct scheduler_backend scheduler_backend_ramqueue = { scheduler_ram_remove, scheduler_ram_suspend, scheduler_ram_resume, + scheduler_ram_query, }; static struct rq_queue ramqueue; @@ -801,6 +803,22 @@ scheduler_ram_resume(uint64_t evpid) } } +static int +scheduler_ram_query(uint64_t evpid) +{ + uint32_t msgid; + + if (evpid > 0xffffffff) + msgid = evpid_to_msgid(evpid); + else + msgid = evpid; + + if (tree_get(&ramqueue.messages, msgid) == NULL) + return (0); + + return (1); +} + static void sorted_insert(struct rq_queue *rq, struct rq_envelope *evp) { |