From: Timo Sirainen Date: Thu, 31 Oct 2019 17:17:28 +0000 (+0200) Subject: director: Add auth_connection.dir X-Git-Tag: 2.3.13~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6d04c95252bd2de9253517fa4f5acabc6ffaa7;p=thirdparty%2Fdovecot%2Fcore.git director: Add auth_connection.dir --- diff --git a/src/director/auth-connection.c b/src/director/auth-connection.c index 63e4ee9596..d232be7984 100644 --- a/src/director/auth-connection.c +++ b/src/director/auth-connection.c @@ -15,6 +15,7 @@ struct auth_connection { struct auth_connection *prev, *next; + struct director *dir; char *path; int fd; struct io *io; @@ -57,11 +58,13 @@ static void auth_connection_input(struct auth_connection *conn) } } -struct auth_connection *auth_connection_init(const char *path) +struct auth_connection * +auth_connection_init(struct director *dir, const char *path) { struct auth_connection *conn; conn = i_new(struct auth_connection, 1); + conn->dir = dir; conn->fd = -1; conn->path = i_strdup(path); DLLIST_PREPEND(&auth_connections, conn); diff --git a/src/director/auth-connection.h b/src/director/auth-connection.h index f91a905a41..d2e12e646b 100644 --- a/src/director/auth-connection.h +++ b/src/director/auth-connection.h @@ -1,11 +1,14 @@ #ifndef AUTH_CONNECTION_H #define AUTH_CONNECTION_H +struct director; + /* Called for each input line. This is also called with line=NULL if connection gets disconnected. */ typedef void auth_input_callback(const char *line, void *context); -struct auth_connection *auth_connection_init(const char *path); +struct auth_connection * +auth_connection_init(struct director *dir, const char *path); void auth_connection_deinit(struct auth_connection **conn); void auth_connection_set_callback(struct auth_connection *conn, diff --git a/src/director/main.c b/src/director/main.c index 123e481e83..640f005182 100644 --- a/src/director/main.c +++ b/src/director/main.c @@ -199,7 +199,7 @@ static void client_connected(struct master_service_connection *conn) userdb = *typep == DIRECTOR_SOCKET_TYPE_USERDB; socket_path = userdb ? AUTH_USERDB_SOCKET_PATH : AUTH_SOCKET_PATH; - auth = auth_connection_init(socket_path); + auth = auth_connection_init(director, socket_path); if (auth_connection_connect(auth) < 0) { auth_connection_deinit(&auth); break;