]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Move iostream-rawlog creation to client_create_finish()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 8 Mar 2021 14:33:50 +0000 (16:33 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 17 May 2021 12:39:14 +0000 (12:39 +0000)
This allows the caller to modify the istream before rawlog.

src/imap/imap-client.c

index 0fafd71060d711a5e97df746e09c40f68ab98eac..be7a4eb864f3239c58c6f9532e8a02ed63a9e4a1 100644 (file)
@@ -156,11 +156,6 @@ struct client *client_create(int fd_in, int fd_out,
        client->notify_flag_changes = TRUE;
        p_array_init(&client->enabled_features, client->pool, 8);
 
-       if (set->rawlog_dir[0] != '\0') {
-               (void)iostream_rawlog_create(set->rawlog_dir, &client->input,
-                                            &client->output);
-       }
-
        client->capability_string =
                str_new(client->pool, sizeof(CAPABILITY_STRING)+64);
 
@@ -229,6 +224,11 @@ int client_create_finish(struct client *client, const char **error_r)
                return -1;
        mail_namespaces_set_storage_callbacks(client->user->namespaces,
                                              &mail_storage_callbacks, client);
+
+       if (client->set->rawlog_dir[0] != '\0') {
+               (void)iostream_rawlog_create(client->set->rawlog_dir,
+                                            &client->input, &client->output);
+       }
        client->io = io_add_istream(client->input, client_input, client);
 
        client->v.init(client);