From dfc46f2376dcbe8a887443563b067e542e79baad Mon Sep 17 00:00:00 2001 From: Eric Faurot Date: Thu, 12 Jan 2012 18:06:19 +0000 Subject: Remove dead code for config reloading for now. It is not functionnal and confusing. ok gilles@ --- usr.sbin/smtpd/control.c | 18 +----------------- usr.sbin/smtpd/parser.c | 3 +-- usr.sbin/smtpd/parser.h | 3 +-- usr.sbin/smtpd/smtp.c | 35 +---------------------------------- usr.sbin/smtpd/smtpctl.c | 3 +-- usr.sbin/smtpd/smtpd.c | 4 ++-- usr.sbin/smtpd/smtpd.h | 8 +------- 7 files changed, 8 insertions(+), 66 deletions(-) (limited to 'usr.sbin/smtpd') diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index 632c459b8f2..ace689b4e11 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.63 2011/11/14 19:23:41 chl Exp $ */ +/* $OpenBSD: control.c,v 1.64 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -65,7 +65,6 @@ void control_imsg(struct imsgev *iev, struct imsg *imsg) { struct ctl_conn *c; - struct reload *reload; log_imsg(PROC_CONTROL, iev->proc, imsg); @@ -81,21 +80,6 @@ control_imsg(struct imsgev *iev, struct imsg *imsg) } } - if (iev->proc == PROC_PARENT) { - switch (imsg->hdr.type) { - case IMSG_CONF_RELOAD: - env->sc_flags &= ~SMTPD_CONFIGURING; - reload = imsg->data; - c = control_connbyfd(reload->fd); - if (c == NULL) - return; - imsg_compose_event(&c->iev, - reload->ret ? IMSG_CTL_OK : IMSG_CTL_FAIL, 0, 0, - -1, NULL, 0); - return; - } - } - errx(1, "control_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } diff --git a/usr.sbin/smtpd/parser.c b/usr.sbin/smtpd/parser.c index 9bdf367a255..ba978925630 100644 --- a/usr.sbin/smtpd/parser.c +++ b/usr.sbin/smtpd/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.23 2011/10/26 20:47:31 gilles Exp $ */ +/* $OpenBSD: parser.c,v 1.24 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard @@ -61,7 +61,6 @@ static const struct token t_main[] = { {KEYWORD, "show", NONE, t_show}, {KEYWORD, "monitor", MONITOR, NULL}, {KEYWORD, "pause", NONE, t_pause}, -/* {KEYWORD, "reload", RELOAD, NULL},*/ {KEYWORD, "remove", NONE, t_remove}, {KEYWORD, "resume", NONE, t_resume}, {KEYWORD, "stop", SHUTDOWN, NULL}, diff --git a/usr.sbin/smtpd/parser.h b/usr.sbin/smtpd/parser.h index 9bdfee1183a..3b344dbca81 100644 --- a/usr.sbin/smtpd/parser.h +++ b/usr.sbin/smtpd/parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.h,v 1.19 2011/10/23 17:12:41 gilles Exp $ */ +/* $OpenBSD: parser.h,v 1.20 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard @@ -19,7 +19,6 @@ enum actions { NONE, SHUTDOWN, - RELOAD, MONITOR, LOG_VERBOSE, LOG_BRIEF, diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index 70b9e0f3dcc..e6af36df5af 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.96 2011/12/13 23:55:00 gilles Exp $ */ +/* $OpenBSD: smtp.c,v 1.97 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -43,7 +43,6 @@ static void smtp_imsg(struct imsgev *, struct imsg *); static void smtp_shutdown(void); static void smtp_sig_handler(int, short, void *); static void smtp_setup_events(void); -static void smtp_disable_events(void); static void smtp_pause(void); static int smtp_enqueue(uid_t *); static void smtp_accept(int, short, void *); @@ -160,21 +159,6 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg) if (iev->proc == PROC_PARENT) { switch (imsg->hdr.type) { - case IMSG_CONF_RELOAD: - /* - * Reloading may invalidate various pointers our - * sessions rely upon, we better tell clients we - * want them to retry. - */ - SPLAY_FOREACH(s, sessiontree, &env->sc_sessions) { - s->s_l = NULL; - s->s_msg.status |= DS_TEMPFAILURE; - } - if (env->sc_listeners) - smtp_disable_events(); - imsg_compose_event(iev, IMSG_PARENT_SEND_CONFIG, 0, 0, -1, - NULL, 0); - return; case IMSG_CONF_START: if (env->sc_flags & SMTPD_CONFIGURING) @@ -406,23 +390,6 @@ smtp_setup_events(void) log_debug("smtp: will accept at most %d clients", env->sc_maxconn); } -static void -smtp_disable_events(void) -{ - struct listener *l; - - log_debug("smtp: closing listening sockets"); - while ((l = TAILQ_FIRST(env->sc_listeners)) != NULL) { - TAILQ_REMOVE(env->sc_listeners, l, entry); - event_del(&l->ev); - close(l->fd); - free(l); - } - free(env->sc_listeners); - env->sc_listeners = NULL; - env->sc_maxconn = 0; -} - static void smtp_pause(void) { diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 34b4d881694..3c042dae0af 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.74 2011/12/18 22:52:25 chl Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.75 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard @@ -251,7 +251,6 @@ connected: if (n == 0) break; switch(res->action) { - /* case RELOAD: */ case REMOVE: case SCHEDULE: case SCHEDULE_ALL: diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 298638750fa..3197f8ac759 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.145 2012/01/12 12:52:11 eric Exp $ */ +/* $OpenBSD: smtpd.c,v 1.146 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -1175,7 +1175,7 @@ imsg_to_str(int type) CASE(IMSG_CONF_RULE_SOURCE); CASE(IMSG_CONF_FILTER); CASE(IMSG_CONF_END); - CASE(IMSG_CONF_RELOAD); + CASE(IMSG_LKA_MAIL); CASE(IMSG_LKA_RCPT); CASE(IMSG_LKA_SECRET); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 0b3cecde6bd..1798dfe8d2b 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.274 2012/01/12 15:01:33 eric Exp $ */ +/* $OpenBSD: smtpd.h,v 1.275 2012/01/12 18:06:18 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -126,7 +126,6 @@ enum imsg_type { IMSG_CONF_RULE_SOURCE, IMSG_CONF_FILTER, IMSG_CONF_END, - IMSG_CONF_RELOAD, IMSG_LKA_MAIL, IMSG_LKA_RCPT, IMSG_LKA_SECRET, @@ -733,11 +732,6 @@ struct stats { struct stat_counter counters[STATS_MAX]; }; -struct reload { - int fd; - int ret; -}; - struct submit_status { u_int64_t id; int code; -- cgit v1.2.3