diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-01 12:12:59 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-01 12:12:59 +0000 |
commit | a89b497936dbcf786711a7fd83a5a321b34fac8f (patch) | |
tree | d8583e704b72d0c75746a9bbbfbc86831bd81cd6 /usr.sbin | |
parent | e5a61ceaaedce871600b2b535c073a3294bf9378 (diff) |
In "smtpctl show stats", break queue.inserts into queue.inserts.remote
and queue.inserts.local; ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/queue.c | 12 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 5 |
3 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 0e2d5d293cb..d529eaf716c 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.56 2009/02/22 19:07:33 chl Exp $ */ +/* $OpenBSD: queue.c,v 1.57 2009/03/01 12:12:58 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -152,7 +152,9 @@ queue_dispatch_control(int sig, short event, void *p) ss.id = messagep->session_id; ss.code = 250; - if (! enqueue_commit_message(messagep)) + if (enqueue_commit_message(messagep)) + s_queue.inserts_local++; + else ss.code = 421; imsg_compose(ibuf, IMSG_QUEUE_COMMIT_MESSAGE, 0, 0, -1, @@ -245,9 +247,9 @@ queue_dispatch_smtp(int sig, short event, void *p) messagep = imsg.data; ss.id = messagep->session_id; - s_queue.inserts++; - - if (! queue_commit_incoming_message(messagep)) + if (queue_commit_incoming_message(messagep)) + s_queue.inserts_remote++; + else ss.code = 421; imsg_compose(ibuf, IMSG_QUEUE_COMMIT_MESSAGE, 0, 0, -1, diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 9f684dc6679..6698641904c 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.15 2009/02/24 12:07:47 gilles Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.16 2009/03/01 12:12:58 jacekm Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -286,7 +286,8 @@ show_stats_output(struct imsg *imsg) printf("parent.uptime=%d\n", time(NULL) - s_parent.start); - printf("queue.inserts=%zd\n", s_queue.inserts); + printf("queue.inserts.local=%zd\n", s_queue.inserts_local); + printf("queue.inserts.remote=%zd\n", s_queue.inserts_remote); printf("runner.active=%zd\n", s_runner.active); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 03a25282a46..3fa2c67cfa5 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.77 2009/02/24 12:07:47 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.78 2009/03/01 12:12:58 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -653,7 +653,8 @@ struct s_parent { }; struct s_queue { - size_t inserts; + size_t inserts_local; + size_t inserts_remote; }; struct s_runner { |