]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-worker-client - Use master_service_connection on constructor
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 19 Nov 2018 12:45:34 +0000 (14:45 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 28 Nov 2018 13:19:16 +0000 (15:19 +0200)
Simplifies following commits

src/auth/auth-worker-client.c
src/auth/auth-worker-client.h
src/auth/main.c

index 44938afffd63b8dd19f4d93e50384a27c03a8f83..db183eb9656bfd889831a061908805a3e6c95fc4 100644 (file)
@@ -799,9 +799,11 @@ static int auth_worker_output(struct auth_worker_client *client)
 }
 
 struct auth_worker_client *
-auth_worker_client_create(struct auth *auth, int fd)
+auth_worker_client_create(struct auth *auth,
+                         const struct master_service_connection *master_conn)
 {
-        struct auth_worker_client *client;
+       struct auth_worker_client *client;
+       int fd = master_conn->fd;
 
        client = i_new(struct auth_worker_client, 1);
        client->refcount = 1;
index 513c960f74ea6feed118289013dd993cde275b2b..99ec8e6a14c6184ce364833c4c6c721e8d620248 100644 (file)
@@ -5,9 +5,12 @@
 #define AUTH_WORKER_PROTOCOL_MINOR_VERSION 0
 #define AUTH_WORKER_MAX_LINE_LENGTH 8192
 
+struct master_service_connection;
 extern struct auth_worker_client *auth_worker_client;
 
-struct auth_worker_client *auth_worker_client_create(struct auth *auth, int fd);
+struct auth_worker_client *
+auth_worker_client_create(struct auth *auth,
+                         const struct master_service_connection *master_conn);
 bool auth_worker_auth_request_new(struct auth_worker_client *client, unsigned int id,
                                  const char *const *args, struct auth_request **request_r);
 void auth_worker_client_destroy(struct auth_worker_client **client);
index 494df33ce6240a93c6d240e6d01ff3f67a6bfe7e..cc7fb3442cea14f8e3f335d562b57842dc6a2be9 100644 (file)
@@ -314,7 +314,7 @@ static void worker_connected(struct master_service_connection *conn)
        }
 
        master_service_client_connection_accept(conn);
-       (void)auth_worker_client_create(auth_default_service(), conn->fd);
+       (void)auth_worker_client_create(auth_default_service(), conn);
 }
 
 static void client_connected(struct master_service_connection *conn)