From b77bf55f02ac9f890173d8279c884f5d4b89fd57 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Wed, 28 Jan 2009 19:38:47 +0000 Subject: 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@ --- usr.sbin/smtpd/smtp.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'usr.sbin/smtpd/smtp.c') 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 @@ -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; } -- cgit v1.2.3