From: Aki Tuomi Date: Mon, 19 Nov 2018 12:45:34 +0000 (+0200) Subject: auth: auth-worker-client - Use master_service_connection on constructor X-Git-Tag: 2.3.9~1059 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5286a6149a893bd40036ea27615dc48e84863410;p=thirdparty%2Fdovecot%2Fcore.git auth: auth-worker-client - Use master_service_connection on constructor Simplifies following commits --- diff --git a/src/auth/auth-worker-client.c b/src/auth/auth-worker-client.c index 44938afffd..db183eb965 100644 --- a/src/auth/auth-worker-client.c +++ b/src/auth/auth-worker-client.c @@ -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; diff --git a/src/auth/auth-worker-client.h b/src/auth/auth-worker-client.h index 513c960f74..99ec8e6a14 100644 --- a/src/auth/auth-worker-client.h +++ b/src/auth/auth-worker-client.h @@ -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); diff --git a/src/auth/main.c b/src/auth/main.c index 494df33ce6..cc7fb3442c 100644 --- a/src/auth/main.c +++ b/src/auth/main.c @@ -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)