diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-01-28 19:38:47 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-01-28 19:38:47 +0000 |
commit | b77bf55f02ac9f890173d8279c884f5d4b89fd57 (patch) | |
tree | 8e2890060141ebec10618c836ce862e932c87a4c /usr.sbin/smtpd/smtp.c | |
parent | f61d235bbd9708fdbdb841ea2940e853f4ad5ad5 (diff) |
when pausing listeners, do not simply disable their events as new
clients would still be able to connect. instead, at pause time we
close and remove the listeners, and at resume time we request the
parent to reconfigure all listeners.
discussed with pyr@
Diffstat (limited to 'usr.sbin/smtpd/smtp.c')
-rw-r--r-- | usr.sbin/smtpd/smtp.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index 0a6dcdc98ff..ee77f657380 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.16 2009/01/04 22:35:09 gilles Exp $ */ +/* $OpenBSD: smtp.c,v 1.17 2009/01/28 19:38:46 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -633,24 +633,17 @@ smtp_disable_events(struct smtpd *env) void smtp_pause(struct smtpd *env) { - struct listener *l; - log_debug("smtp_pause_listeners: pausing listening sockets"); - TAILQ_FOREACH(l, &env->sc_listeners, entry) { - event_del(&l->ev); - } + smtp_disable_events(env); env->sc_opts |= SMTPD_SMTP_PAUSED; } void smtp_resume(struct smtpd *env) { - struct listener *l; - log_debug("smtp_pause_listeners: resuming listening sockets"); - TAILQ_FOREACH(l, &env->sc_listeners, entry) { - event_add(&l->ev, NULL); - } + imsg_compose(env->sc_ibufs[PROC_PARENT], IMSG_PARENT_SEND_CONFIG, + 0, 0, -1, NULL, 0); env->sc_opts &= ~SMTPD_SMTP_PAUSED; } |