[dovecot-cvs] dovecot/src/lib-auth auth-client.c, 1.17, 1.18 auth-client.h, 1.16, 1.17

tss at dovecot.org tss at dovecot.org
Sun Mar 18 16:08:29 EET 2007


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

Modified Files:
	auth-client.c auth-client.h 
Log Message:
Call auth_client_reconnect() when the last client has disconnected to make
sure all the memory used by the auth connections get cleared.



Index: auth-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- auth-client.c	28 Dec 2006 15:21:55 -0000	1.17
+++ auth-client.c	18 Mar 2007 14:08:26 -0000	1.18
@@ -50,6 +50,19 @@
 	i_free(client);
 }
 
+void auth_client_reconnect(struct auth_client *client)
+{
+	struct auth_server_connection *next;
+
+	while (client->connections != NULL) {
+		next = client->connections->next;
+		auth_server_connection_destroy(&client->connections, FALSE);
+		client->connections = next;
+	}
+
+	auth_client_connect_missing_servers(client);
+}
+
 const struct auth_mech_desc *
 auth_client_get_available_mechs(struct auth_client *client,
 				unsigned int *mech_count)

Index: auth-client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- auth-client.h	15 Dec 2006 18:10:54 -0000	1.16
+++ auth-client.h	18 Mar 2007 14:08:26 -0000	1.17
@@ -44,6 +44,9 @@
 struct auth_client *auth_client_new(unsigned int client_pid);
 void auth_client_free(struct auth_client **client);
 
+/* Destroy all connections and reconnect. */
+void auth_client_reconnect(struct auth_client *client);
+
 bool auth_client_is_connected(struct auth_client *client);
 void auth_client_set_connect_notify(struct auth_client *client,
 				    auth_connect_notify_callback_t *callback,



More information about the dovecot-cvs mailing list