dovecot-2.0-sslstream: auth: Cleaned up auth worker client deini...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:32 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/faf2339212b8
changeset: 10158:faf2339212b8
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 22 22:12:56 2009 -0400
description:
auth: Cleaned up auth worker client deinit code.

diffstat:

2 files changed, 6 insertions(+), 6 deletions(-)
src/auth/auth-worker-client.c |   10 +++++-----
src/auth/main.c               |    2 +-

diffs (46 lines):

diff -r 85f3282cfe4f -r faf2339212b8 src/auth/auth-worker-client.c
--- a/src/auth/auth-worker-client.c	Thu Oct 22 22:01:43 2009 -0400
+++ b/src/auth/auth-worker-client.c	Thu Oct 22 22:12:56 2009 -0400
@@ -411,6 +411,8 @@ static void list_iter_deinit(struct auth
 	struct auth_worker_client *client = ctx->client;
 	string_t *str;
 
+	i_assert(client->io == NULL);
+
 	str = t_str_new(32);
 	if (ctx->userdb->iface->iterate_deinit(ctx->iter) < 0)
 		str_printfa(str, "%u\tFAIL\n", ctx->id);
@@ -616,8 +618,9 @@ void auth_worker_client_destroy(struct a
 
 	net_disconnect(client->fd);
 	client->fd = -1;
-
-        master_service_client_connection_destroyed(master_service);
+	auth_worker_client_unref(&client);
+
+	master_service_client_connection_destroyed(master_service);
 }
 
 void auth_worker_client_unref(struct auth_worker_client **_client)
@@ -628,9 +631,6 @@ void auth_worker_client_unref(struct aut
 		*_client = NULL;
 		return;
 	}
-
-	if (client->fd != -1)
-		auth_worker_client_destroy(_client);
 
 	i_stream_unref(&client->input);
 	o_stream_unref(&client->output);
diff -r 85f3282cfe4f -r faf2339212b8 src/auth/main.c
--- a/src/auth/main.c	Thu Oct 22 22:01:43 2009 -0400
+++ b/src/auth/main.c	Thu Oct 22 22:12:56 2009 -0400
@@ -88,7 +88,7 @@ static void main_deinit(void)
 static void main_deinit(void)
 {
 	if (worker_client != NULL)
-		auth_worker_client_unref(&worker_client);
+		auth_worker_client_destroy(&worker_client);
 	else
 		auth_request_handler_flush_failures(TRUE);
 


More information about the dovecot-cvs mailing list