changeset 9424:bf11870ecb02 HEAD

login proxy: Don't give "tried to change state 2 -> 2" errors with login_process_per_connection=yes.
author Timo Sirainen <tss@iki.fi>
date Mon, 12 Oct 2009 14:05:02 -0400
parents c50acaf1f09f
children 1c529a941c99
files src/login-common/login-proxy.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/login-common/login-proxy.c	Mon Oct 12 12:36:38 2009 -0400
+++ b/src/login-common/login-proxy.c	Mon Oct 12 14:05:02 2009 -0400
@@ -252,6 +252,7 @@
 {
 	struct login_proxy *proxy = *_proxy;
 	const char *ipstr;
+	bool detached;
 
 	*_proxy = NULL;
 
@@ -274,7 +275,8 @@
 	if (proxy->server_output != NULL)
 		o_stream_destroy(&proxy->server_output);
 
-	if (proxy->client_fd != -1) {
+	detached = proxy->client_fd != -1;
+	if (detached) {
 		/* detached proxy */
 		main_unref();
 		DLLIST_REMOVE(&login_proxies, proxy);
@@ -305,7 +307,8 @@
 	i_free(proxy->user);
 	i_free(proxy);
 
-	main_listen_start();
+	if (detached)
+		main_listen_start();
 }
 
 bool login_proxy_is_ourself(const struct client *client, const char *host,