From: Karl Fleischmann Date: Mon, 21 Feb 2022 15:11:39 +0000 (+0100) Subject: auth: Clean up naming for auth worker connections X-Git-Tag: 2.4.0~4219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a12dca9047fe9c0578202abc9451c84944fcc9ae;p=thirdparty%2Fdovecot%2Fcore.git auth: Clean up naming for auth worker connections Similar to the indexer this commit consolidates the naming of the auth-worker setup into a header file. This reduces the effort to write the appropriate name correctly in 4 different places. --- diff --git a/src/auth/auth-worker-client.c b/src/auth/auth-worker-client.c index 751840db79..abd7ea6eb2 100644 --- a/src/auth/auth-worker-client.c +++ b/src/auth/auth-worker-client.c @@ -888,8 +888,8 @@ static const struct connection_vfuncs auth_worker_client_v = static const struct connection_settings auth_worker_client_set = { - .service_name_in = "auth-worker", - .service_name_out = "auth-worker", + .service_name_in = AUTH_MASTER_NAME, + .service_name_out = AUTH_WORKER_NAME, .major_version = AUTH_WORKER_PROTOCOL_MAJOR_VERSION, .minor_version = AUTH_WORKER_PROTOCOL_MINOR_VERSION, .input_max_size = SIZE_MAX, diff --git a/src/auth/auth-worker-client.h b/src/auth/auth-worker-client.h index e41ee83aab..8552c432a2 100644 --- a/src/auth/auth-worker-client.h +++ b/src/auth/auth-worker-client.h @@ -1,6 +1,8 @@ #ifndef AUTH_WORKER_CLIENT_H #define AUTH_WORKER_CLIENT_H +#define AUTH_MASTER_NAME "auth-master" +#define AUTH_WORKER_NAME "auth-worker" #define AUTH_WORKER_PROTOCOL_MAJOR_VERSION 1 #define AUTH_WORKER_PROTOCOL_MINOR_VERSION 0 #define AUTH_WORKER_MAX_LINE_LENGTH 8192 diff --git a/src/auth/auth-worker-server.c b/src/auth/auth-worker-server.c index f5ef6ded01..dddc786549 100644 --- a/src/auth/auth-worker-server.c +++ b/src/auth/auth-worker-server.c @@ -446,8 +446,8 @@ static void worker_input_resume(struct auth_worker_connection *worker) static const struct connection_settings auth_worker_server_settings = { - .service_name_in = "auth-worker", - .service_name_out = "auth-worker", + .service_name_in = AUTH_WORKER_NAME, + .service_name_out = AUTH_MASTER_NAME, .major_version = AUTH_WORKER_PROTOCOL_MAJOR_VERSION, .minor_version = AUTH_WORKER_PROTOCOL_MINOR_VERSION, .client = TRUE,