[dovecot-cvs] dovecot/src/master login-process.c,1.81,1.82

tss at dovecot.org tss at dovecot.org
Thu Oct 12 10:13:39 UTC 2006


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv7011

Modified Files:
	login-process.c 
Log Message:
If login process dies before initialization, stall creation of them instead
of completely shutting down.



Index: login-process.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/login-process.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- login-process.c	11 Oct 2006 12:17:27 -0000	1.81
+++ login-process.c	12 Oct 2006 09:13:36 -0000	1.82
@@ -54,6 +54,7 @@
 static struct hash_table *processes;
 static struct login_group *login_groups;
 
+static void login_processes_stall(void);
 static void login_process_destroy(struct login_process *p);
 static void login_process_unref(struct login_process *p);
 static bool login_process_init_group(struct login_process *p);
@@ -176,6 +177,20 @@
 	process_remove_from_prelogin_lists(p);
 }
 
+static void login_process_set_initialized(struct login_process *p)
+{
+	p->initialized = TRUE;
+
+	if (logins_stalled) {
+		/* processes were created successfully */
+		i_info("Created login processes successfully, unstalling");
+
+		logins_stalled = FALSE;
+		timeout_remove(&to);
+		to = timeout_add(1000, login_processes_start_missing, NULL);
+	}
+}
+
 static void
 login_process_set_state(struct login_process *p, enum master_login_state state)
 {
@@ -377,7 +392,7 @@
 
 		if (!p->initialized) {
 			/* initialization notify */
-			p->initialized = TRUE;;
+			login_process_set_initialized(p);
 		} else {
 			/* change "listening for new connections" status */
 			login_process_set_state(p, state);
@@ -453,10 +468,8 @@
 		return;
 	p->destroyed = TRUE;
 
-	if (!p->initialized && io_loop_is_running(ioloop)) {
-		i_error("Login process died too early - shutting down");
-		io_loop_stop(ioloop);
-	}
+	if (!p->initialized)
+		login_processes_stall();
 
 	o_stream_close(p->output);
 	io_remove(&p->io);
@@ -768,7 +781,6 @@
 	to = timeout_add(60*1000, login_processes_start_missing, NULL);
 }
 
-
 static void
 login_processes_start_missing(void *context __attr_unused__)
 {
@@ -783,15 +795,6 @@
 			return;
 		}
 	}
-
-	if (logins_stalled) {
-		/* processes were created successfully */
-		i_info("Created login processes successfully, unstalling");
-
-		logins_stalled = FALSE;
-		timeout_remove(&to);
-		to = timeout_add(1000, login_processes_start_missing, NULL);
-	}
 }
 
 static int login_process_send_env(struct login_process *p)



More information about the dovecot-cvs mailing list