Skip to content

Commit

Permalink
doveadm: client: Set IO only after enabling SSL
Browse files Browse the repository at this point in the history
io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.
  • Loading branch information
sirainen committed Feb 8, 2018
1 parent 330041c commit 14995d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doveadm/server-connection.c
Expand Up @@ -544,7 +544,6 @@ int server_connection_create(struct doveadm_server *server,
doveadm_settings->doveadm_port);
net_set_nonblock(conn->fd, TRUE);
conn->input = i_stream_create_fd(conn->fd, MAX_INBUF_SIZE);
conn->io = io_add_istream(conn->input, server_connection_input, conn);
conn->output = o_stream_create_fd(conn->fd, (size_t)-1);
o_stream_set_flush_callback(conn->output, server_connection_output, conn);
o_stream_set_no_error_handling(conn->output, TRUE);
Expand All @@ -559,6 +558,7 @@ int server_connection_create(struct doveadm_server *server,
server_connection_destroy(&conn);
return -1;
}
conn->io = io_add_istream(conn->input, server_connection_input, conn);

conn->state = SERVER_REPLY_STATE_DONE;
o_stream_nsend_str(conn->output, DOVEADM_SERVER_PROTOCOL_VERSION_LINE"\n");
Expand Down

0 comments on commit 14995d3

Please sign in to comment.