Mercurial > dovecot > core-2.2
changeset 21516:d1772c456530
mail-filter: Handle handshake write() failure
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 10 Feb 2017 13:13:01 +0200 |
parents | d2a22c25b8b4 |
children | 22f45b987ad6 |
files | src/plugins/mail-filter/istream-ext-filter.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/mail-filter/istream-ext-filter.c Fri Feb 10 12:50:58 2017 +0200 +++ b/src/plugins/mail-filter/istream-ext-filter.c Fri Feb 10 13:13:01 2017 +0200 @@ -148,6 +148,7 @@ { const char **argv; string_t *str; + ssize_t ret; int fd; argv = t_strsplit(args, " "); @@ -179,7 +180,14 @@ } str_append_c(str, '\n'); - o_stream_send(mstream->ext_out, str_data(str), str_len(str)); + ret = o_stream_send(mstream->ext_out, str_data(str), str_len(str)); + if (ret < 0) { + i_error("ext-filter: write(%s) failed: %s", socket_path, + o_stream_get_error(mstream->ext_out)); + i_stream_mail_filter_close(&mstream->istream.iostream, FALSE); + return -1; + } + i_assert((size_t)ret == str_len(str)); return 0; }