diff options
-rw-r--r-- | usr.sbin/smtpd/queue.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 239d31f4731..a4f5a19ecec 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.141 2012/11/12 14:58:53 eric Exp $ */ +/* $OpenBSD: queue.c,v 1.142 2012/11/13 13:23:23 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -419,7 +419,16 @@ queue_timeout(int fd, short event, void *p) } while (qwalk(q, &evpid)) { - if (! queue_envelope_load(evpid, &envelope)) + + if (msgid && evpid_to_msgid(evpid) != msgid && evpcount) { + imsg_compose_event(env->sc_ievs[PROC_SCHEDULER], + IMSG_QUEUE_COMMIT_MESSAGE, 0, 0, -1, &msgid, + sizeof msgid); + evpcount = 0; + } + msgid = evpid_to_msgid(evpid); + + if (!queue_envelope_load(evpid, &envelope)) log_warnx("warn: Failed to load envelope %016"PRIx64, evpid); else { @@ -429,14 +438,6 @@ queue_timeout(int fd, short event, void *p) evpcount++; } - if (msgid && evpid_to_msgid(evpid) != msgid && evpcount) { - imsg_compose_event(env->sc_ievs[PROC_SCHEDULER], - IMSG_QUEUE_COMMIT_MESSAGE, 0, 0, -1, &msgid, - sizeof msgid); - evpcount = 0; - } - - msgid = evpid_to_msgid(evpid); tv.tv_sec = 0; tv.tv_usec = 0; evtimer_add(ev, &tv); |