|
|
27f02a |
From c7d158681fabdb3044bd213c332e489b46625a3b Mon Sep 17 00:00:00 2001
|
|
|
27f02a |
From: Timo Sirainen <timo.sirainen@open-xchange.com>
|
|
|
27f02a |
Date: Mon, 24 Aug 2020 19:10:10 +0300
|
|
|
27f02a |
Subject: [PATCH] imap: Delay initializing client IO until
|
|
|
27f02a |
client_create_finish()
|
|
|
27f02a |
|
|
|
27f02a |
This helps writing unit tests.
|
|
|
27f02a |
---
|
|
|
27f02a |
src/imap/imap-client.c | 2 +-
|
|
|
27f02a |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
27f02a |
|
|
|
27f02a |
diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c
|
|
|
27f02a |
index 95e57dbf53..c8ffeafc43 100644
|
|
|
27f02a |
--- a/src/imap/imap-client.c
|
|
|
27f02a |
+++ b/src/imap/imap-client.c
|
|
|
27f02a |
@@ -143,7 +143,6 @@ struct client *client_create(int fd_in, int fd_out,
|
|
|
27f02a |
o_stream_set_flush_callback(client->output, client_output, client);
|
|
|
27f02a |
|
|
|
27f02a |
p_array_init(&client->module_contexts, client->pool, 5);
|
|
|
27f02a |
- client->io = io_add_istream(client->input, client_input, client);
|
|
|
27f02a |
client->last_input = ioloop_time;
|
|
|
27f02a |
client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
|
|
|
27f02a |
client_idle_timeout, client);
|
|
|
27f02a |
@@ -228,6 +227,7 @@ int client_create_finish(struct client *client, const char **error_r)
|
|
|
27f02a |
return -1;
|
|
|
27f02a |
mail_namespaces_set_storage_callbacks(client->user->namespaces,
|
|
|
27f02a |
&mail_storage_callbacks, client);
|
|
|
27f02a |
+ client->io = io_add_istream(client->input, client_input, client);
|
|
|
27f02a |
|
|
|
27f02a |
client->v.init(client);
|
|
|
27f02a |
return 0;
|