diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-11-21 18:57:55 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-11-21 18:57:55 +0000 |
commit | 05b9d02a38989ac02a0061cac3bfb45a599582c5 (patch) | |
tree | 0eef0e8605cc0f35060eff8f272ef440c8a38a87 /usr.sbin/smtpd | |
parent | 32480d976e5508ba30258e1e7ca8c53ba229083f (diff) |
get rid of the "enqueue/" queue; use "incoming/" instead.
ok gilles@ chl@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/queue.c | 43 | ||||
-rw-r--r-- | usr.sbin/smtpd/queue_fsqueue.c | 12 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 3 |
3 files changed, 16 insertions, 42 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 642143e0fa1..ccd6a8acad5 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.112 2011/11/15 23:06:39 gilles Exp $ */ +/* $OpenBSD: queue.c,v 1.113 2011/11/21 18:57:54 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -62,10 +62,7 @@ queue_imsg(struct imsgev *iev, struct imsg *imsg) ss.id = e->session_id; ss.code = 250; ss.u.msgid = 0; - if (e->flags & DF_ENQUEUED) - ret = queue_message_create(Q_ENQUEUE, &ss.u.msgid); - else - ret = queue_message_create(Q_INCOMING, &ss.u.msgid); + ret = queue_message_create(Q_INCOMING, &ss.u.msgid); if (ret == 0) ss.code = 421; imsg_compose_event(iev, IMSG_QUEUE_CREATE_MESSAGE, 0, 0, -1, @@ -73,25 +70,17 @@ queue_imsg(struct imsgev *iev, struct imsg *imsg) return; case IMSG_QUEUE_REMOVE_MESSAGE: - if (e->flags & DF_ENQUEUED) - queue_message_purge(Q_ENQUEUE, evpid_to_msgid(e->id)); - else - queue_message_purge(Q_INCOMING, evpid_to_msgid(e->id)); + queue_message_purge(Q_INCOMING, evpid_to_msgid(e->id)); return; case IMSG_QUEUE_COMMIT_MESSAGE: ss.id = e->session_id; - if (e->flags & DF_ENQUEUED) { - if (queue_message_commit(Q_ENQUEUE, evpid_to_msgid(e->id))) - stat_increment(STATS_QUEUE_LOCAL); - else - ss.code = 421; - } else { - if (queue_message_commit(Q_INCOMING, evpid_to_msgid(e->id))) - stat_increment(STATS_QUEUE_REMOTE); - else - ss.code = 421; - } + if (queue_message_commit(Q_INCOMING, evpid_to_msgid(e->id))) + stat_increment(e->flags & DF_ENQUEUED ? + STATS_QUEUE_LOCAL : STATS_QUEUE_REMOTE); + else + ss.code = 421; + imsg_compose_event(iev, IMSG_QUEUE_COMMIT_MESSAGE, 0, 0, -1, &ss, sizeof ss); @@ -102,10 +91,7 @@ queue_imsg(struct imsgev *iev, struct imsg *imsg) case IMSG_QUEUE_MESSAGE_FILE: ss.id = e->session_id; - if (e->flags & DF_ENQUEUED) - fd = queue_message_fd_rw(Q_ENQUEUE, evpid_to_msgid(e->id)); - else - fd = queue_message_fd_rw(Q_INCOMING, evpid_to_msgid(e->id)); + fd = queue_message_fd_rw(Q_INCOMING, evpid_to_msgid(e->id)); if (fd == -1) ss.code = 421; imsg_compose_event(iev, IMSG_QUEUE_MESSAGE_FILE, 0, 0, fd, @@ -124,13 +110,7 @@ queue_imsg(struct imsgev *iev, struct imsg *imsg) switch (imsg->hdr.type) { case IMSG_QUEUE_SUBMIT_ENVELOPE: ss.id = e->session_id; - - /* Write to disk */ - if (e->flags & DF_ENQUEUED) - ret = queue_envelope_create(Q_ENQUEUE, e); - else - ret = queue_envelope_create(Q_INCOMING, e); - + ret = queue_envelope_create(Q_INCOMING, e); if (ret == 0) { ss.code = 421; imsg_compose_event(env->sc_ievs[PROC_SMTP], @@ -303,7 +283,6 @@ queue(void) config_peers(peers, nitems(peers)); queue_purge(Q_INCOMING); - queue_purge(Q_ENQUEUE); if (event_dispatch() < 0) fatal("event_dispatch"); diff --git a/usr.sbin/smtpd/queue_fsqueue.c b/usr.sbin/smtpd/queue_fsqueue.c index 07aef0aba12..3c95fd1e681 100644 --- a/usr.sbin/smtpd/queue_fsqueue.c +++ b/usr.sbin/smtpd/queue_fsqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_fsqueue.c,v 1.20 2011/11/15 23:12:44 gilles Exp $ */ +/* $OpenBSD: queue_fsqueue.c,v 1.21 2011/11/21 18:57:54 eric Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org> @@ -65,7 +65,6 @@ void *fsqueue_qwalk_new(enum queue_kind, u_int32_t); int fsqueue_qwalk(void *, u_int64_t *); void fsqueue_qwalk_close(void *); -#define PATH_ENQUEUE "/enqueue" #define PATH_INCOMING "/incoming" #define PATH_QUEUE "/queue" #define PATH_PURGE "/purge" @@ -83,9 +82,6 @@ fsqueue_getpath(enum queue_kind kind) case Q_INCOMING: return (PATH_INCOMING); - case Q_ENQUEUE: - return (PATH_ENQUEUE); - case Q_QUEUE: return (PATH_QUEUE); @@ -375,7 +371,7 @@ fsqueue_message_fd_r(enum queue_kind qkind, u_int32_t msgid) int fd; char pathname[MAXPATHLEN]; - if (qkind == Q_ENQUEUE || qkind == Q_INCOMING) { + if (qkind == Q_INCOMING) { if (! bsnprintf(pathname, sizeof(pathname), "%s/%08x/message", fsqueue_getpath(qkind), msgid)) fatal("fsqueue_message_fd_r: snprintf"); @@ -517,7 +513,7 @@ int fsqueue_init(void) { unsigned int n; - char *paths[] = { PATH_INCOMING, PATH_ENQUEUE, PATH_QUEUE, + char *paths[] = { PATH_INCOMING, PATH_QUEUE, PATH_PURGE, PATH_BOUNCE, PATH_CORRUPT }; char path[MAXPATHLEN]; int ret; @@ -646,7 +642,7 @@ fsqueue_qwalk_new(enum queue_kind kind, u_int32_t msgid) if (kind == Q_QUEUE) q->filefn = walk_queue; - if (kind == Q_INCOMING || kind == Q_ENQUEUE || kind == Q_PURGE) + if (kind == Q_INCOMING || kind == Q_PURGE) q->filefn = walk_queue_nobucket; q->dirs[q->level] = opendir(q->path); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index ff906d916fb..9af4f9d6a38 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.253 2011/11/16 19:38:56 eric Exp $ */ +/* $OpenBSD: smtpd.h,v 1.254 2011/11/21 18:57:54 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -884,7 +884,6 @@ enum queue_type { enum queue_kind { Q_INVALID=0, - Q_ENQUEUE, Q_INCOMING, Q_QUEUE, Q_PURGE, |