diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-18 20:23:36 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-18 20:23:36 +0000 |
commit | 70d04b4454983db7f8ade89c13bbf7afd8c5c946 (patch) | |
tree | d75be19c4c8d99803499e99d4c00ac0170e449ac /usr.sbin/smtpd/smtpctl.c | |
parent | 8ea800ac124a5b897090f73a4ecb57ffc0b0075d (diff) |
Complete rework of bufferevent event masking allowing for more
strictness:
- Drop clients attempting command pipelining; protects the daemon
from all kinds of abuse.
- Replace F_EVLOCKED flag with F_WRITEONLY which has cleaner sematics:
when up, session must not be destroyed nor read from, but may be
written to.
- Write callback becomes a central place for enabling EV_READ.
- Delay bufferevent creation until after ssl handshake is completed.
A bunch of session error stats were added to smtpctl's "show stats".
These could help spotting event masking errors in the future.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/smtpctl.c')
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index ecd1cc457ca..ed4bcb3cd86 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.24 2009/04/23 08:28:45 jacekm Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.25 2009/05/18 20:23:35 jacekm Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -294,10 +294,22 @@ show_stats_output(struct imsg *imsg) printf("runner.active=%zd\n", s_runner.active); + printf("smtp.errors.linetoolong=%zd\n", s_smtp.linetoolong); + printf("smtp.errors.read_eof=%zd\n", s_smtp.read_eof); + printf("smtp.errors.read_system=%zd\n", s_smtp.read_error); + printf("smtp.errors.read_timeout=%zd\n", s_smtp.read_timeout); + printf("smtp.errors.tempfail=%zd\n", s_smtp.tempfail); + printf("smtp.errors.toofast=%zd\n", s_smtp.toofast); + printf("smtp.errors.write_eof=%zd\n", s_smtp.write_eof); + printf("smtp.errors.write_system=%zd\n", s_smtp.write_error); + printf("smtp.errors.write_timeout=%zd\n", s_smtp.write_timeout); + printf("smtp.sessions=%zd\n", s_smtp.sessions); - printf("smtp.sessions.aborted=%zd\n", s_smtp.aborted); + printf("smtp.sessions.aborted=%zd\n", s_smtp.read_eof + + s_smtp.read_error + s_smtp.write_eof + s_smtp.write_error); printf("smtp.sessions.active=%zd\n", s_smtp.sessions_active); - printf("smtp.sessions.timeout=%zd\n", s_smtp.timeout); + printf("smtp.sessions.timeout=%zd\n", s_smtp.read_timeout + + s_smtp.write_timeout); printf("smtp.sessions.smtps=%zd\n", s_smtp.smtps); printf("smtp.sessions.smtps.active=%zd\n", s_smtp.smtps_active); printf("smtp.sessions.starttls=%zd\n", s_smtp.starttls); |