From: Timo Sirainen Date: Thu, 4 Nov 2010 16:25:39 +0000 (+0000) Subject: istream-attachment: Error handling improvements. X-Git-Tag: 2.0.7~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=170d90af1304bbcc6b9591df93c14ba259f063cf;p=thirdparty%2Fdovecot%2Fcore.git istream-attachment: Error handling improvements. --- diff --git a/src/lib-storage/index/istream-attachment.c b/src/lib-storage/index/istream-attachment.c index 528dad400f..efcfa2c2ce 100644 --- a/src/lib-storage/index/istream-attachment.c +++ b/src/lib-storage/index/istream-attachment.c @@ -53,10 +53,14 @@ static ssize_t i_stream_attachment_read(struct istream_private *stream) stream->istream.eof = TRUE; } else if (!stream->istream.eof) { /* still more to read */ + } else if (stream->istream.stream_errno == ENOENT) { + /* lost the file */ } else { i_error("Attachment file %s smaller than expected " - "(%"PRIuUOFF_T")", i_stream_get_name(stream->parent), - astream->size); + "(%"PRIuUOFF_T" < %"PRIuUOFF_T")", + i_stream_get_name(stream->parent), + stream->istream.v_offset, astream->size); + stream->istream.stream_errno = EIO; } ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :