dovecot-2.2: dsync: Stream disconnection error message improvement

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 6 17:17:10 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/64464646c020
changeset: 16673:64464646c020
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 06 17:16:58 2013 +0300
description:
dsync: Stream disconnection error message improvement

diffstat:

 src/doveadm/dsync/dsync-ibc-stream.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r e52284d3cc76 -r 64464646c020 src/doveadm/dsync/dsync-ibc-stream.c
--- a/src/doveadm/dsync/dsync-ibc-stream.c	Tue Aug 06 17:06:50 2013 +0300
+++ b/src/doveadm/dsync/dsync-ibc-stream.c	Tue Aug 06 17:16:58 2013 +0300
@@ -357,6 +357,7 @@
 static int dsync_ibc_stream_next_line(struct dsync_ibc_stream *ibc,
 				      const char **line_r)
 {
+	string_t *error;
 	const char *line;
 
 	line = i_stream_next_line(ibc->input);
@@ -368,13 +369,19 @@
 	if (i_stream_read(ibc->input) == -1) {
 		if (ibc->stopped)
 			return -1;
+		error = t_str_new(128);
 		if (ibc->input->stream_errno != 0) {
 			errno = ibc->input->stream_errno;
-			i_error("read(%s) failed: %m", ibc->name);
+			str_printfa(error, "read(%s) failed: %m", ibc->name);
 		} else {
 			i_assert(ibc->input->eof);
-			i_error("read(%s) failed: EOF", ibc->name);
+			str_printfa(error, "read(%s) failed: EOF", ibc->name);
 		}
+		if (!ibc->version_received)
+			str_append(error, " (version not received)");
+		else if (!ibc->handshake_received)
+			str_append(error, " (handshake not received)");
+		i_error("%s", str_c(error));
 		dsync_ibc_stream_stop(ibc);
 		return -1;
 	}


More information about the dovecot-cvs mailing list