diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2011-09-01 19:56:50 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2011-09-01 19:56:50 +0000 |
commit | ad47ec1eeb8b886915ea232368f798df48ab734d (patch) | |
tree | b82ac55260162a3f1cdc3b009a94233126a1ecfc /usr.sbin/smtpd/smtp_session.c | |
parent | 9541d1e9935ed1f995936e6a2abd46c1ee30eaed (diff) |
Introduce a small set of functions to manage stat counters in a
simpler and hopefully saner way.
ok gilles@ chl@
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 9832e218eb5..32ba1db59ac 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.145 2011/09/01 09:42:15 chl Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.146 2011/09/01 19:56:49 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -1020,11 +1020,9 @@ session_destroy(struct session *s) if (s->s_fd != -1 && close(s->s_fd) == -1) fatal("session_destroy: close"); - env->stats->smtp.sessions_active--; - /* resume when session count decreases to 95% */ resume = env->sc_maxconn * 95 / 100; - if (env->stats->smtp.sessions_active == resume) { + if (stat_decrement(STATS_SMTP_SESSION) == resume) { log_warnx("re-enabling incoming connections"); smtp_resume(); } |