dovecot-2.0: *-login: If we disconnect from auth server, make su...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Feb 19 12:08:09 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/ce1dd7328b20
changeset: 10767:ce1dd7328b20
user: Timo Sirainen <tss at iki.fi>
date: Fri Feb 19 12:04:31 2010 +0200
description:
*-login: If we disconnect from auth server, make sure we reconnect back when necessary.
diffstat:
src/lib-auth/auth-client.c | 6 ++++++
src/lib-auth/auth-client.h | 1 +
src/login-common/main.c | 3 +++
3 files changed, 10 insertions(+), 0 deletions(-)
diffs (40 lines):
diff -r 300ac0c2cac3 -r ce1dd7328b20 src/lib-auth/auth-client.c
--- a/src/lib-auth/auth-client.c Fri Feb 19 07:16:03 2010 +0200
+++ b/src/lib-auth/auth-client.c Fri Feb 19 12:04:31 2010 +0200
@@ -31,6 +31,12 @@
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);
diff -r 300ac0c2cac3 -r ce1dd7328b20 src/lib-auth/auth-client.h
--- a/src/lib-auth/auth-client.h Fri Feb 19 07:16:03 2010 +0200
+++ b/src/lib-auth/auth-client.h Fri Feb 19 12:04:31 2010 +0200
@@ -54,6 +54,7 @@
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,
diff -r 300ac0c2cac3 -r ce1dd7328b20 src/login-common/main.c
--- a/src/login-common/main.c Fri Feb 19 07:16:03 2010 +0200
+++ b/src/login-common/main.c Fri Feb 19 12:04:31 2010 +0200
@@ -211,6 +211,9 @@
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);
More information about the dovecot-cvs
mailing list