summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2016-08-31 21:49:02 +0000
committerEric Faurot <eric@cvs.openbsd.org>2016-08-31 21:49:02 +0000
commit70677c65a4fa7b624d3f5a75e33afd3ad0dbefc7 (patch)
treeb750a28a6b4309be9b6980b485e312c6248b11bd
parent4d61dffefd8130fac324267ccec79cd3f597424b (diff)
Remove dead code. queue_flow_control() has never been used and is
probably a bad idea. ok gilles@
-rw-r--r--usr.sbin/smtpd/mproc.c7
-rw-r--r--usr.sbin/smtpd/queue.c57
-rw-r--r--usr.sbin/smtpd/smtpd.h3
3 files changed, 3 insertions, 64 deletions
diff --git a/usr.sbin/smtpd/mproc.c b/usr.sbin/smtpd/mproc.c
index a1c0336a4a5..7006d31c36c 100644
--- a/usr.sbin/smtpd/mproc.c
+++ b/usr.sbin/smtpd/mproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mproc.c,v 1.20 2016/06/06 20:48:15 eric Exp $ */
+/* $OpenBSD: mproc.c,v 1.21 2016/08/31 21:49:01 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@ -218,11 +218,6 @@ mproc_dispatch(int fd, short event, void *arg)
imsg_free(&imsg);
}
-#if 0
- if (smtpd_process == PROC_QUEUE)
- queue_flow_control();
-#endif
-
mproc_event_add(p);
}
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c
index 6660f96cf2d..5582d04b297 100644
--- a/usr.sbin/smtpd/queue.c
+++ b/usr.sbin/smtpd/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.178 2016/05/28 21:21:20 eric Exp $ */
+/* $OpenBSD: queue.c,v 1.179 2016/08/31 21:49:01 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -49,15 +49,6 @@ static void queue_sig_handler(int, short, void *);
static void queue_log(const struct envelope *, const char *, const char *);
static void queue_msgid_walk(int, short, void *);
-static size_t flow_agent_hiwat = 10 * 1024 * 1024;
-static size_t flow_agent_lowat = 1 * 1024 * 1024;
-static size_t flow_scheduler_hiwat = 10 * 1024 * 1024;
-static size_t flow_scheduler_lowat = 1 * 1024 * 1024;
-
-#define LIMIT_AGENT 0x01
-#define LIMIT_SCHEDULER 0x02
-
-static int limit = 0;
static void
queue_imsg(struct mproc *p, struct imsg *imsg)
@@ -797,49 +788,3 @@ queue_log(const struct envelope *e, const char *prefix, const char *status)
duration_to_text(time(NULL) - e->creation),
status);
}
-
-void
-queue_flow_control(void)
-{
- size_t bufsz;
- int oldlimit = limit;
- int set, unset;
-
- bufsz = p_pony->bytes_queued;
- if (bufsz <= flow_agent_lowat)
- limit &= ~LIMIT_AGENT;
- else if (bufsz > flow_agent_hiwat)
- limit |= LIMIT_AGENT;
-
- if (p_scheduler->bytes_queued <= flow_scheduler_lowat)
- limit &= ~LIMIT_SCHEDULER;
- else if (p_scheduler->bytes_queued > flow_scheduler_hiwat)
- limit |= LIMIT_SCHEDULER;
-
- set = limit & (limit ^ oldlimit);
- unset = oldlimit & (limit ^ oldlimit);
-
- if (set & LIMIT_SCHEDULER) {
- log_warnx("warn: queue: Hiwat reached on scheduler buffer: "
- "suspending transfer, delivery and lookup input");
- mproc_disable(p_pony);
- mproc_disable(p_lka);
- }
- else if (unset & LIMIT_SCHEDULER) {
- log_warnx("warn: queue: Down to lowat on scheduler buffer: "
- "resuming transfer, delivery and lookup input");
- mproc_enable(p_pony);
- mproc_enable(p_lka);
- }
-
- if (set & LIMIT_AGENT) {
- log_warnx("warn: queue: Hiwat reached on transfer and delivery "
- "buffers: suspending scheduler input");
- mproc_disable(p_scheduler);
- }
- else if (unset & LIMIT_AGENT) {
- log_warnx("warn: queue: Down to lowat on transfer and delivery "
- "buffers: resuming scheduler input");
- mproc_enable(p_scheduler);
- }
-}
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index a2a01c5f551..be15fe87512 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.518 2016/08/31 15:24:04 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.519 2016/08/31 21:49:01 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -1341,7 +1341,6 @@ int cmdline_symset(char *);
/* queue.c */
int queue(void);
-void queue_flow_control(void);
/* queue_backend.c */