summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2012-01-11 22:55:17 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2012-01-11 22:55:17 +0000
commit84f6b871a8b35f0306f4dd0fc519523aafbd07eb (patch)
tree388da255eab3e63b20692212cca32c5eb0d99697 /usr.sbin/smtpd
parent6a2b04355f2529c19f95eb94af376947daf40a00 (diff)
remove stateful iteration from ramqueue, if we ever need to reintroduce it
we'll do it, but it isn't used and causes potential bugs idea by Nathanael Rensel, diff by me, ok eric@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/ramqueue.c12
-rw-r--r--usr.sbin/smtpd/smtpd.h3
2 files changed, 3 insertions, 12 deletions
diff --git a/usr.sbin/smtpd/ramqueue.c b/usr.sbin/smtpd/ramqueue.c
index 371a12defbf..a2c586f6a29 100644
--- a/usr.sbin/smtpd/ramqueue.c
+++ b/usr.sbin/smtpd/ramqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ramqueue.c,v 1.27 2012/01/11 22:40:36 gilles Exp $ */
+/* $OpenBSD: ramqueue.c,v 1.28 2012/01/11 22:55:16 gilles Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org>
@@ -60,7 +60,6 @@ ramqueue_init(struct ramqueue *rqueue)
TAILQ_INIT(&rqueue->queue);
RB_INIT(&rqueue->hosttree);
RB_INIT(&rqueue->msgtree);
- rqueue->current_evp = NULL;
}
int
@@ -96,11 +95,7 @@ ramqueue_first_envelope(struct ramqueue *rqueue)
struct ramqueue_envelope *
ramqueue_next_envelope(struct ramqueue *rqueue)
{
- if (rqueue->current_evp == NULL)
- rqueue->current_evp = TAILQ_FIRST(&rqueue->queue);
- else
- rqueue->current_evp = TAILQ_NEXT(rqueue->current_evp, queue_entry);
- return rqueue->current_evp;
+ return TAILQ_FIRST(&rqueue->queue);
}
struct ramqueue_envelope *
@@ -456,9 +451,6 @@ ramqueue_remove_envelope(struct ramqueue *rq, struct ramqueue_envelope *rq_evp)
struct ramqueue_batch *rq_batch;
struct ramqueue_message *rq_msg;
- if (rq_evp == rq->current_evp)
- rq->current_evp = TAILQ_NEXT(rq->current_evp, queue_entry);
-
rq_msg = rq_evp->rq_msg;
rq_batch = rq_evp->rq_batch;
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index b3b7fb680e7..b236a278e13 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.272 2012/01/11 22:24:37 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.273 2012/01/11 22:55:16 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -608,7 +608,6 @@ struct ramqueue_message {
u_int32_t msgid;
};
struct ramqueue {
- struct ramqueue_envelope *current_evp;
RB_HEAD(hosttree, ramqueue_host) hosttree;
RB_HEAD(msgtree, ramqueue_message) msgtree;
TAILQ_HEAD(,ramqueue_envelope) queue;