diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-06-01 14:38:46 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-06-01 14:38:46 +0000 |
commit | 4c7862e787e10c16b3cf1d4e73043a66ebb4e4d1 (patch) | |
tree | 8690a47400badf2048b19c673a255f3b3db276f1 | |
parent | 372a2374bbc8778a8253cfb1dadaef378dce8660 (diff) |
Don't destroy listening socket when pause/resume request is received,
use event_del/event_add instead; ok gilles@
-rw-r--r-- | usr.sbin/smtpd/smtp.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index 7a09bfe1a81..f2e83c240e7 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.53 2009/06/01 13:20:56 jacekm Exp $ */ +/* $OpenBSD: smtp.c,v 1.54 2009/06/01 14:38:45 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -675,18 +675,25 @@ smtp_disable_events(struct smtpd *env) void smtp_pause(struct smtpd *env) { + struct listener *l; + log_debug("smtp_pause: pausing listening sockets"); - smtp_disable_events(env); env->sc_opts |= SMTPD_SMTP_PAUSED; + + TAILQ_FOREACH(l, &env->sc_listeners, entry) + event_del(&l->ev); } void smtp_resume(struct smtpd *env) { + struct listener *l; + log_debug("smtp_resume: resuming listening sockets"); - imsg_compose(env->sc_ibufs[PROC_PARENT], IMSG_PARENT_SEND_CONFIG, - 0, 0, -1, NULL, 0); env->sc_opts &= ~SMTPD_SMTP_PAUSED; + + TAILQ_FOREACH(l, &env->sc_listeners, entry) + event_add(&l->ev, NULL); } void |