This could have happened if there was any logging done outside command
handling. For example a doveadm command used http-client, which has a
timeout that triggers logging only after the command is finished.
Fixes segfault and:
Panic: file http-client.c: line 642 (http_client_context_close): assertion failed: (cctx->clients_list == NULL)
/* since we can get here from just about anywhere, make sure
the log ostream uses the connection's ioloop. */
- io_loop_set_current(conn->ioloop);
+ if (conn->ioloop != NULL)
+ io_loop_set_current(conn->ioloop);
c = doveadm_log_type_to_char(ctx->type);
corked = o_stream_is_corked(log_out);