]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth-client: Add AUTH_MASTER_FLAG_NO_INNER_IOLOOP for testing
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 16 Feb 2024 12:33:48 +0000 (14:33 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 29 Feb 2024 12:28:27 +0000 (14:28 +0200)
src/lib-auth-client/auth-master.c
src/lib-auth-client/auth-master.h

index 3b132c6388a9f1d643902edde9d8bd0f5fad2cbe..6f849f51d149a9f11bc6ab5e22f3689d8ecf17b7 100644 (file)
@@ -114,6 +114,8 @@ auth_master_init(const char *auth_socket_path, enum auth_master_flags flags)
        connection_init_client_unix(conn->clist, &conn->conn,
                                    conn->auth_socket_path);
 
+       if ((flags & AUTH_MASTER_FLAG_NO_INNER_IOLOOP) != 0)
+               conn->ioloop = current_ioloop;
        return conn;
 }
 
@@ -422,7 +424,8 @@ static void auth_master_unset_io(struct auth_master_connection *conn)
        if (conn->prev_ioloop != NULL) {
                io_loop_set_current(conn->prev_ioloop);
        }
-       if (conn->ioloop != NULL) {
+       if (conn->ioloop != NULL &&
+           (conn->flags & AUTH_MASTER_FLAG_NO_INNER_IOLOOP) == 0) {
                io_loop_set_current(conn->ioloop);
                connection_switch_ioloop_to(&conn->conn, conn->ioloop);
                connection_input_halt(&conn->conn);
index 7fa79059b7de3445826d30c99ebadb953bb0eb1f..5d32c500ad2ab52527b8d5d370c8636594fb7c28 100644 (file)
@@ -7,7 +7,9 @@ enum auth_master_flags {
        /* Enable logging debug information */
        AUTH_MASTER_FLAG_DEBUG                  = 0x01,
        /* Don't disconnect from auth socket when idling */
-       AUTH_MASTER_FLAG_NO_IDLE_TIMEOUT        = 0x02
+       AUTH_MASTER_FLAG_NO_IDLE_TIMEOUT        = 0x02,
+       /* No inner ioloop (testing only) */
+       AUTH_MASTER_FLAG_NO_INNER_IOLOOP        = 0x04,
 };
 
 struct auth_user_info {