From a952e178943a5944255cb7c053d970f8e6d49336 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 5 Jun 2018 20:23:52 +0300 Subject: [PATCH] doveadm-server: Fix hang when sending a lot of output to clients Nowadays ostream adds its io to the stream's specified ioloop, not to current ioloop. --- src/doveadm/client-connection-tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doveadm/client-connection-tcp.c b/src/doveadm/client-connection-tcp.c index a2e1358d7f..672017495d 100644 --- a/src/doveadm/client-connection-tcp.c +++ b/src/doveadm/client-connection-tcp.c @@ -336,6 +336,9 @@ static int doveadm_cmd_handle(struct client_connection_tcp *conn, running one and we can't call the original one recursively, so create a new ioloop. */ conn->ioloop = io_loop_create(); + o_stream_switch_ioloop(conn->output); + if (conn->log_out != NULL) + o_stream_switch_ioloop(conn->log_out); if (cmd_ver2 != NULL) doveadm_cmd_server_run_ver2(conn, argc, argv, cctx);