]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Use the new listener type field to distinguish the various listener types.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 22 Nov 2022 20:44:30 +0000 (21:44 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Sun, 11 Dec 2022 21:58:50 +0000 (21:58 +0000)
src/doveadm/doveadm-settings.c
src/doveadm/main.c

index b024e1c5c1ca62112f51318f491f8e7418f3cc27..a4b2a963b69c32d48b36bee144903082abf94883 100644 (file)
@@ -23,6 +23,7 @@ static bool doveadm_settings_check(void *_set, pool_t pool, const char **error_r
 static struct file_listener_settings doveadm_unix_listeners_array[] = {
        {
                .path = "doveadm-server",
+               .type = "tcp",
                .mode = 0600,
                .user = "",
                .group = "",
index f7ede399017c82670d8ab8bbfbbd4e5d8528324e..e819fface7079955b1bf8621e10f394d93ff77bb 100644 (file)
@@ -31,13 +31,16 @@ static void doveadm_die(void)
 
 static void client_connected(struct master_service_connection *conn)
 {
+       const char *type;
+
        if (doveadm_client != NULL) {
                i_error("doveadm server can handle only a single client");
                return;
        }
 
        master_service_client_connection_accept(conn);
-       if (strcmp(conn->name, "http") == 0) {
+       type = master_service_connection_get_type(conn);
+       if (strcmp(type, "http") == 0) {
                doveadm_client = client_connection_http_create(conn->fd, conn->ssl);
        } else {
                doveadm_client = client_connection_tcp_create(conn->fd, conn->listen_fd,