diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-08-25 22:03:27 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-08-25 22:03:27 +0000 |
commit | 2c067add9c463aafef136c70a0c999661ce12b6e (patch) | |
tree | b80bc94d41c44ac44f68e3775812e6221b2a49ce /usr.sbin/smtpd/smtp.c | |
parent | eec2ff128e49acadf64a2573cba4c4b98595d29d (diff) |
- add myself to the copyright in control.c, i've done quite a few changes
there in the last few years ;-)
- get rid of availdesc(): getdtablecount() is so much more reliable
- get rid of env->sc_maxconn, we can be much smarter with getdtablecount()
and getdtablesize()
- disable accept when we hit the control process fd reserve
- disable accept when we fail
- enable accept when we're back below the limit
this is not the full fd exhaustion diff, i'll merge changes from relayd
tomorrow, this was only required to get rid of the env->sc_maxconn and
availdesc() mess
"reads alright" eric@
Diffstat (limited to 'usr.sbin/smtpd/smtp.c')
-rw-r--r-- | usr.sbin/smtpd/smtp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index e3580168c3d..14405eb767f 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.107 2012/08/25 21:33:33 gilles Exp $ */ +/* $OpenBSD: smtp.c,v 1.108 2012/08/25 22:03:26 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -356,9 +356,7 @@ smtp(void) signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); - /* Initial limit for use by IMSG_SMTP_ENQUEUE, will be tuned later once - * the listening sockets arrive. */ - env->sc_maxconn = availdesc() / 2; + fdlimit(1.0); config_pipes(peers, nitems(peers)); config_peers(peers, nitems(peers)); @@ -374,7 +372,6 @@ static void smtp_setup_events(void) { struct listener *l; - int avail = availdesc(); TAILQ_FOREACH(l, env->sc_listeners, entry) { log_debug("smtp: listen on %s port %d flags 0x%01x" @@ -390,7 +387,6 @@ smtp_setup_events(void) event_add(&l->ev, NULL); ssl_setup(l); - avail--; } log_debug("smtp: will accept at most %d clients", |