]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Move finishing istream to client_create_finish()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 8 Mar 2021 14:44:31 +0000 (16:44 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 17 May 2021 12:39:14 +0000 (12:39 +0000)
src/pop3/pop3-client.c
src/pop3/pop3-client.h

index e5021d4d81c484e0aeb922c86997b1f40786f648..d06ced8dc1ce7600efe750ff880cfb35eeb74c93 100644 (file)
@@ -403,13 +403,7 @@ struct client *client_create(int fd_in, int fd_out,
        o_stream_set_no_error_handling(client->output, TRUE);
        o_stream_set_flush_callback(client->output, client_output, client);
 
-       if (set->rawlog_dir[0] != '\0') {
-               (void)iostream_rawlog_create(set->rawlog_dir, &client->input,
-                                            &client->output);
-       }
-
        p_array_init(&client->module_contexts, client->pool, 5);
-       client->io = io_add_istream(client->input, client_input, client);
         client->last_input = ioloop_time;
        client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
                                      client_idle_timeout, client);
@@ -442,6 +436,15 @@ struct client *client_create(int fd_in, int fd_out,
        return client;
 }
 
+void client_create_finish(struct client *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);
+}
+
 int client_init_mailbox(struct client *client, const char **error_r)
 {
         enum mailbox_flags flags;
index b6f666ee9ef5394578588514dc99a64bfa19b1fd..5cb3f466eb15c2f1c938da2b5a6af8d2c42ecf2d 100644 (file)
@@ -124,6 +124,7 @@ struct client *client_create(int fd_in, int fd_out,
                             struct mail_user *user,
                             struct mail_storage_service_user *service_user,
                             const struct pop3_settings *set);
+void client_create_finish(struct client *client);
 int client_init_mailbox(struct client *client, const char **error_r);
 void client_destroy(struct client *client, const char *reason) ATTR_NULL(2);