diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-24 14:22:25 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-24 14:22:25 +0000 |
commit | 576522606d25ccb68ce580aa9b2d77ae382c9c2d (patch) | |
tree | f88ad8bb62fe63d49e1c80739d0ac06c72e5c269 /usr.sbin/smtpd/queue.c | |
parent | 1d52421f171ee8c2a55ae5923fae4352e1f531fb (diff) |
Instead of keeping stats private to each process, and querying every
process individually whenever stats need to be fetched, keep stats
in MAP_ANON shared memory allocated by parent.
This means control has direct access to stats and can respond very
quickly without troubling any other daemon processes.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
-rw-r--r-- | usr.sbin/smtpd/queue.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 64c1e53c362..efd11dbe7f7 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.63 2009/05/19 11:24:24 jacekm Exp $ */ +/* $OpenBSD: queue.c,v 1.64 2009/05/24 14:22:23 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -56,8 +56,6 @@ 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) { @@ -107,15 +105,6 @@ queue_dispatch_control(int sig, short event, void *p) break; switch (imsg.hdr.type) { - case IMSG_STATS: { - struct stats *s = imsg.data; - - IMSG_SIZE_CHECK(s); - - s->u.queue = s_queue; - imsg_compose(ibuf, IMSG_STATS, 0, 0, -1, s, sizeof(*s)); - break; - } default: log_warnx("queue_dispatch_control: got imsg %d", imsg.hdr.type); @@ -214,10 +203,10 @@ queue_dispatch_smtp(int sig, short event, void *p) if (messagep->flags & F_MESSAGE_ENQUEUED) { f = enqueue_commit_message; - counter = &s_queue.inserts_local; + counter = &env->stats->queue.inserts_local; } else { f = queue_commit_incoming_message; - counter = &s_queue.inserts_remote; + counter = &env->stats->queue.inserts_remote; } if (f(messagep)) |