struct auth_connection {
struct auth_connection *prev, *next;
+ struct director *dir;
char *path;
int fd;
struct io *io;
}
}
-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);
#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,
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;