changeset 20118:aea22ac41008

lib-fs: Fixed fs_get_metadata() with fs-metawrap If mail was already read to EOF.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sat, 30 Apr 2016 01:05:47 +0300
parents f212d5a84776
children a6154f9100d4
files src/lib-fs/fs-metawrap.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-fs/fs-metawrap.c	Tue Apr 26 14:27:39 2016 -0600
+++ b/src/lib-fs/fs-metawrap.c	Sat Apr 30 01:05:47 2016 +0300
@@ -220,8 +220,12 @@
 			if (fs_wait_async(_file->fs) < 0)
 				return -1;
 		}
-		if (ret == -1)
+		if (ret == -1 && file->input->stream_errno != 0) {
+			fs_set_error(_file->fs, "read(%s) failed: %s",
+				     i_stream_get_name(file->input),
+				     i_stream_get_error(file->input));
 			return -1;
+		}
 		i_assert(file->metadata_read);
 	}
 	*metadata_r = &_file->metadata;