dovecot-1.1: login processes: Another try at setting the correct...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 6 19:54:56 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/ea6aea0a4cbb
changeset: 7815:ea6aea0a4cbb
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 06 12:54:50 2008 -0400
description:
login processes: Another try at setting the correct fd limit.

diffstat:

1 file changed, 7 insertions(+), 5 deletions(-)
src/login-common/main.c |   12 +++++++-----

diffs (31 lines):

diff -r cded69dd00a6 -r ea6aea0a4cbb src/login-common/main.c
--- a/src/login-common/main.c	Wed Aug 06 12:48:02 2008 -0400
+++ b/src/login-common/main.c	Wed Aug 06 12:54:50 2008 -0400
@@ -223,10 +223,10 @@ void connection_queue_add(unsigned int c
 
 	current_count = clients_get_count() + ssl_proxy_get_count() +
 		login_proxy_get_count();
-	if (current_count + connection_count + 1 >= max_connections) {
+	if (current_count + connection_count + 2 >= max_connections) {
 		/* after this client we've reached max users count,
-		   so stop listening for more. reserve +1 extra for SSL
-		   connections. */
+		   so stop listening for more. reserve +2 extra for SSL with
+		   login proxy connections. */
 		main_listen_stop();
 
 		if (current_count >= max_connections) {
@@ -281,9 +281,11 @@ static void drop_privileges(void)
 	max_connections = value == NULL ? 1 : strtoul(value, NULL, 10);
 
 	/* set the number of fds we want to use. it may get increased or
-	   decreased. leave a couple of extra fds for auth sockets and such */
+	   decreased. leave a couple of extra fds for auth sockets and such.
+	   normal connections each use one fd, but SSL connections use two */
 	restrict_fd_limit(LOGIN_MASTER_SOCKET_FD + 16 +
-			  listen_count + ssl_listen_count + max_connections);
+			  listen_count + ssl_listen_count +
+			  max_connections*2);
 
 	/* Refuse to run as root - we should never need it and it's
 	   dangerous with SSL. */


More information about the dovecot-cvs mailing list