diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2010-04-21 18:54:44 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2010-04-21 18:54:44 +0000 |
commit | 039508336e38511115bb4db1b0f40a6ba98f4d6e (patch) | |
tree | c8c694ec1ea12d4e3abaa596b67e867eb79c288f /usr.sbin/smtpd/control.c | |
parent | a52dbb97255938d67eae8ab413b242f7ec736bcd (diff) |
Runner process is just a helper for queue, so tear down its imsg
channels to parent, mda, mta, lka, smtp, and control. This leaves
just the channel to queue, which forwards imsgs on runner's behalf
and redirects any replies back to it.
OK gilles@
Diffstat (limited to 'usr.sbin/smtpd/control.c')
-rw-r--r-- | usr.sbin/smtpd/control.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index 61dced2793b..b4ec43365a9 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.48 2010/04/21 08:29:01 jacekm Exp $ */ +/* $OpenBSD: control.c,v 1.49 2010/04/21 18:54:43 jacekm Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -78,9 +78,9 @@ control_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) } } - if (iev->proc == PROC_RUNNER) { + if (iev->proc == PROC_QUEUE) { switch (imsg->hdr.type) { - case IMSG_RUNNER_SCHEDULE: + case IMSG_QUEUE_SCHEDULE: sched = imsg->data; c = control_connbyfd(sched->fd); if (c == NULL) @@ -90,7 +90,7 @@ control_imsg(struct smtpd *env, struct imsgev *iev, struct imsg *imsg) NULL, 0); return; - case IMSG_RUNNER_REMOVE: + case IMSG_QUEUE_REMOVE: rem = imsg->data; c = control_connbyfd(rem->fd); if (c == NULL) @@ -146,7 +146,6 @@ control(struct smtpd *env) struct event ev_sigterm; struct peer peers [] = { { PROC_QUEUE, imsg_dispatch }, - { PROC_RUNNER, imsg_dispatch }, { PROC_SMTP, imsg_dispatch }, { PROC_MFA, imsg_dispatch }, { PROC_PARENT, imsg_dispatch }, @@ -395,7 +394,7 @@ control_dispatch_ext(int fd, short event, void *arg) imsg_compose_event(&c->iev, IMSG_STATS, 0, 0, -1, env->stats, sizeof(struct stats)); break; - case IMSG_RUNNER_SCHEDULE: { + case IMSG_QUEUE_SCHEDULE: { struct sched *s = imsg.data; if (euid) @@ -412,11 +411,11 @@ control_dispatch_ext(int fd, short event, void *arg) break; } - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_RUNNER_SCHEDULE, 0, 0, -1, s, sizeof(*s)); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_QUEUE_SCHEDULE, 0, 0, -1, s, sizeof(*s)); break; } - case IMSG_RUNNER_REMOVE: { + case IMSG_QUEUE_REMOVE: { struct remove *s = imsg.data; if (euid) @@ -433,7 +432,7 @@ control_dispatch_ext(int fd, short event, void *arg) break; } - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_RUNNER_REMOVE, 0, 0, -1, s, sizeof(*s)); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_QUEUE_REMOVE, 0, 0, -1, s, sizeof(*s)); break; } /* @@ -488,7 +487,7 @@ control_dispatch_ext(int fd, short event, void *arg) imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; } - case IMSG_MDA_PAUSE: + case IMSG_QUEUE_PAUSE_LOCAL: if (euid) goto badcred; @@ -498,11 +497,11 @@ control_dispatch_ext(int fd, short event, void *arg) break; } env->sc_flags |= SMTPD_MDA_PAUSED; - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_MDA_PAUSE, - 0, 0, -1, NULL, 0); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], + IMSG_QUEUE_PAUSE_LOCAL, 0, 0, -1, NULL, 0); imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; - case IMSG_MTA_PAUSE: + case IMSG_QUEUE_PAUSE_OUTGOING: if (euid) goto badcred; @@ -512,8 +511,8 @@ control_dispatch_ext(int fd, short event, void *arg) break; } env->sc_flags |= SMTPD_MTA_PAUSED; - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_MTA_PAUSE, - 0, 0, -1, NULL, 0); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], + IMSG_QUEUE_PAUSE_OUTGOING, 0, 0, -1, NULL, 0); imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; case IMSG_SMTP_PAUSE: @@ -530,7 +529,7 @@ control_dispatch_ext(int fd, short event, void *arg) 0, 0, -1, NULL, 0); imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; - case IMSG_MDA_RESUME: + case IMSG_QUEUE_RESUME_LOCAL: if (euid) goto badcred; @@ -540,11 +539,11 @@ control_dispatch_ext(int fd, short event, void *arg) break; } env->sc_flags &= ~SMTPD_MDA_PAUSED; - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_MDA_RESUME, - 0, 0, -1, NULL, 0); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], + IMSG_QUEUE_RESUME_LOCAL, 0, 0, -1, NULL, 0); imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; - case IMSG_MTA_RESUME: + case IMSG_QUEUE_RESUME_OUTGOING: if (euid) goto badcred; @@ -554,8 +553,8 @@ control_dispatch_ext(int fd, short event, void *arg) break; } env->sc_flags &= ~SMTPD_MTA_PAUSED; - imsg_compose_event(env->sc_ievs[PROC_RUNNER], IMSG_MTA_RESUME, - 0, 0, -1, NULL, 0); + imsg_compose_event(env->sc_ievs[PROC_QUEUE], + IMSG_QUEUE_RESUME_OUTGOING, 0, 0, -1, NULL, 0); imsg_compose_event(&c->iev, IMSG_CTL_OK, 0, 0, -1, NULL, 0); break; case IMSG_SMTP_RESUME: |