[dovecot-cvs] dovecot/src/lib-auth auth-client.c, 1.16, 1.17 auth-server-connection.h, 1.11, 1.12

tss at dovecot.org tss at dovecot.org
Thu Dec 28 15:21:57 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-auth
In directory talvi:/tmp/cvs-serv30354

Modified Files:
	auth-client.c auth-server-connection.h 
Log Message:
If no auth sockets are found in 10 seconds, kill ourself.


Index: auth-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- auth-client.c	15 Dec 2006 18:38:11 -0000	1.16
+++ auth-client.c	28 Dec 2006 15:21:55 -0000	1.17
@@ -10,6 +10,8 @@
 #include <dirent.h>
 #include <sys/stat.h>
 
+#define AUTH_CLIENT_SOCKET_MAX_WAIT_TIME 10
+
 struct auth_client *auth_client_new(unsigned int client_pid)
 {
 	struct auth_client *client;
@@ -147,13 +149,21 @@
 		}
 	}
 
+	if (client->connections == NULL && !client->reconnect) {
+		if (client->missing_sockets_start_time == 0)
+			client->missing_sockets_start_time = ioloop_time;
+		else if (ioloop_time - client->missing_sockets_start_time >
+			 AUTH_CLIENT_SOCKET_MAX_WAIT_TIME)
+			i_fatal("No authentication sockets found");
+	}
+
 	if (closedir(dirp) < 0)
 		i_error("closedir() failed: %m");
 
 	if (client->reconnect || client->connections == NULL) {
 		if (client->to_reconnect == NULL) {
 			client->to_reconnect =
-				timeout_add(5000, reconnect_timeout, client);
+				timeout_add(1000, reconnect_timeout, client);
 		}
 	} else if (client->to_reconnect != NULL)
 		timeout_remove(&client->to_reconnect);

Index: auth-server-connection.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-server-connection.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- auth-server-connection.h	15 Dec 2006 17:16:26 -0000	1.11
+++ auth-server-connection.h	28 Dec 2006 15:21:55 -0000	1.12
@@ -7,6 +7,7 @@
 	struct auth_server_connection *connections;
 	struct timeout *to_reconnect;
 
+	time_t missing_sockets_start_time;
 	unsigned int conn_waiting_handshake_count;
 
 	buffer_t *available_auth_mechs;



More information about the dovecot-cvs mailing list