]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Add auth_connection.dir
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 31 Oct 2019 17:17:28 +0000 (19:17 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 21 Aug 2020 06:10:21 +0000 (06:10 +0000)
src/director/auth-connection.c
src/director/auth-connection.h
src/director/main.c

index 63e4ee9596e311b3bf108a6cf9a1ced1a31ac81c..d232be7984bdb91a1f85a52e1226f0f7bfa1805d 100644 (file)
@@ -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);
index f91a905a417688b1f1e34ec26ed67910305d99fa..d2e12e646beb3e2ed14693fb6e459793595c5c84 100644 (file)
@@ -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,
index 123e481e8382b1d57a166a80fb69c6da98246ebc..640f0051825f546fb3fd2e6c841bb147eb452b4a 100644 (file)
@@ -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;