]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
*-login: If we disconnect from auth server, make sure we reconnect back when necessary.
authorTimo Sirainen <tss@iki.fi>
Fri, 19 Feb 2010 10:04:31 +0000 (12:04 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 19 Feb 2010 10:04:31 +0000 (12:04 +0200)
--HG--
branch : HEAD

src/lib-auth/auth-client.c
src/lib-auth/auth-client.h
src/login-common/main.c

index 3185187eddcd5d5eb5d64686b3a73dc82c3f3b21..d28aaffce047932b45aae681236204bb1087de2e 100644 (file)
@@ -31,6 +31,12 @@ void auth_client_deinit(struct auth_client **_client)
        i_free(client);
 }
 
+void auth_client_connect(struct auth_client *client)
+{
+       if (client->conn->fd == -1)
+               auth_server_connection_connect(client->conn);
+}
+
 void auth_client_disconnect(struct auth_client *client)
 {
        auth_server_connection_disconnect(client->conn);
index 78566170b47f5d0e41642af83e42445d90991553..fc376b2e0007071530025933fff30eacbdabc740 100644 (file)
@@ -54,6 +54,7 @@ auth_client_init(const char *auth_socket_path, unsigned int client_pid,
                 bool debug);
 void auth_client_deinit(struct auth_client **client);
 
+void auth_client_connect(struct auth_client *client);
 void auth_client_disconnect(struct auth_client *client);
 bool auth_client_is_connected(struct auth_client *client);
 void auth_client_set_connect_notify(struct auth_client *client,
index 8c0f759e3db9bbc7d90c41561bdd27964a2ff15f..8ffdfd2925dc197ec49d15b9d84e3cc3b83bd017 100644 (file)
@@ -211,6 +211,9 @@ static void client_connected(const struct master_service_connection *conn)
                global_login_settings->login_access_sockets;
        struct login_access_lookup *lookup;
 
+       /* make sure we're connected (or attempting to connect) to auth */
+       auth_client_connect(auth_client);
+
        if (*access_sockets == '\0') {
                /* no access checks */
                client_connected_finish(conn);