Mercurial > dovecot > core-2.2
changeset 18484:1b3224f0135f
lib: Fixed crash in connection API if input streams aren't used (only input fd).
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 25 Apr 2015 11:52:02 +0300 |
parents | 2c5b0ad65885 |
children | 211099aefe77 |
files | src/lib/connection.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/connection.c Sat Apr 25 11:40:23 2015 +0300 +++ b/src/lib/connection.c Sat Apr 25 11:52:02 2015 +0300 @@ -117,6 +117,9 @@ conn->input = i_stream_create_fd(conn->fd_in, set->input_max_size, FALSE); i_stream_set_name(conn->input, conn->name); + conn->io = io_add_istream(conn->input, *conn->list->v.input, conn); + } else { + conn->io = io_add(conn->fd_in, IO_READ, *conn->list->v.input, conn); } if (set->output_max_size != 0) { conn->output = o_stream_create_fd(conn->fd_out, @@ -124,7 +127,6 @@ o_stream_set_no_error_handling(conn->output, TRUE); o_stream_set_name(conn->output, conn->name); } - conn->io = io_add_istream(conn->input, *conn->list->v.input, conn); if (set->input_idle_timeout_secs != 0) { conn->to = timeout_add(set->input_idle_timeout_secs*1000, connection_idle_timeout, conn);