dovecot-2.1: lib-settings: Improved error messages when config s...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Mar 4 15:18:17 EET 2013
details: http://hg.dovecot.org/dovecot-2.1/rev/09fcb43c47a4
changeset: 14930:09fcb43c47a4
user: Timo Sirainen <tss at iki.fi>
date: Mon Mar 04 15:18:08 2013 +0200
description:
lib-settings: Improved error messages when config server disconnects too early.
diffstat:
src/lib-settings/settings-parser.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diffs (36 lines):
diff -r 311371856dcf -r 09fcb43c47a4 src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c Wed Feb 27 13:07:35 2013 +0200
+++ b/src/lib-settings/settings-parser.c Mon Mar 04 15:18:08 2013 +0200
@@ -950,8 +950,15 @@
if (input->stream_errno != 0) {
ctx->error = p_strdup_printf(ctx->parser_pool,
"read() failed: %m");
+ } else if (input->v_offset == 0) {
+ ctx->error = p_strdup_printf(ctx->parser_pool,
+ "read(%s) disconnected before receiving any data",
+ i_stream_get_name(input));
} else {
- ctx->error = "input is missing end-of-settings line";
+ ctx->error = p_strdup_printf(ctx->parser_pool,
+ "read(%s) disconnected before receiving "
+ "end-of-settings line",
+ i_stream_get_name(input));
}
break;
case -2:
@@ -982,6 +989,7 @@
}
input = i_stream_create_fd(fd, max_line_length, TRUE);
+ i_stream_set_name(input, path);
ret = settings_parse_stream_read(ctx, input);
i_stream_unref(&input);
@@ -1071,6 +1079,7 @@
(void)close(fd[1]);
input = i_stream_create_fd(fd[0], (size_t)-1, TRUE);
+ i_stream_set_name(input, bin_path);
ret = settings_parse_stream_read(ctx, input);
i_stream_destroy(&input);
More information about the dovecot-cvs
mailing list