]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Merge client_connected() to client_connected_finish()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 25 Mar 2022 07:20:16 +0000 (09:20 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 31 Mar 2022 12:14:39 +0000 (12:14 +0000)
Does not need to be separate anymore

src/login-common/main.c

index 3c3bb3eba467f707458e34bd94e973351e237e54..41ef867936e0104d029b86404543a4fb74f31c7d 100644 (file)
@@ -152,7 +152,7 @@ static void login_die(void)
 }
 
 static void
-client_connected_finish(const struct master_service_connection *conn)
+client_connected(struct master_service_connection *conn)
 {
        struct client *client;
        const struct login_settings *set;
@@ -161,6 +161,18 @@ client_connected_finish(const struct master_service_connection *conn)
        pool_t pool;
        void **other_sets;
 
+       master_service_client_connection_accept(conn);
+
+       if (conn->remote_ip.family != 0) {
+               /* log the connection's IP address in case we crash. it's of
+                  course possible that another earlier client causes the
+                  crash, but this is better than nothing. */
+               i_set_failure_send_ip(&conn->remote_ip);
+       }
+
+       /* make sure we're connected (or attempting to connect) to auth */
+       auth_client_connect(auth_client);
+
        pool = pool_alloconly_create("login client", 8*1024);
        set = login_settings_read(pool, &conn->local_ip,
                                  &conn->remote_ip, NULL,
@@ -191,23 +203,6 @@ static const struct master_admin_client_callback admin_callbacks = {
        .cmd_kick_user = master_admin_cmd_kick_user,
 };
 
-static void client_connected(struct master_service_connection *conn)
-{
-       master_service_client_connection_accept(conn);
-
-       if (conn->remote_ip.family != 0) {
-               /* log the connection's IP address in case we crash. it's of
-                  course possible that another earlier client causes the
-                  crash, but this is better than nothing. */
-               i_set_failure_send_ip(&conn->remote_ip);
-       }
-
-       /* make sure we're connected (or attempting to connect) to auth */
-       auth_client_connect(auth_client);
-
-       client_connected_finish(conn);
-}
-
 static void auth_connect_notify(struct auth_client *client ATTR_UNUSED,
                                bool connected, void *context ATTR_UNUSED)
 {