diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-29 21:59:16 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-29 21:59:16 +0000 |
commit | 32cf7735bdfdf1d426921ec6fd3a2dde493d74f9 (patch) | |
tree | 14d38785253d6cd2bbbcf19da89548582da71f04 /usr.sbin/smtpd/queue.c | |
parent | acdcfa87b77e045144bec3e56d7cd8360bcf2e3d (diff) |
Implement "smtpctl show stats"; ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
-rw-r--r-- | usr.sbin/smtpd/queue.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 0b4d1857d4a..8e33f7333ce 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.52 2009/01/29 12:43:25 jacekm Exp $ */ +/* $OpenBSD: queue.c,v 1.53 2009/01/29 21:59:15 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -55,6 +55,8 @@ int queue_remove_layout_envelope(char *, struct message *); int queue_commit_layout_message(char *, struct message *); int queue_open_layout_messagefile(char *, struct message *); +struct s_queue s_queue; + void queue_sig_handler(int sig, short event, void *p) { @@ -157,6 +159,14 @@ queue_dispatch_control(int sig, short event, void *p) break; } + case IMSG_STATS: { + struct stats *s; + + s = imsg.data; + s->u.queue = s_queue; + imsg_compose(ibuf, IMSG_STATS, 0, 0, -1, s, sizeof(*s)); + break; + } default: log_debug("queue_dispatch_control: unexpected imsg %d", imsg.hdr.type); @@ -234,6 +244,8 @@ 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)) ss.code = 421; |