]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
istream-attachment: Error handling improvements.
authorTimo Sirainen <tss@iki.fi>
Thu, 4 Nov 2010 16:25:39 +0000 (16:25 +0000)
committerTimo Sirainen <tss@iki.fi>
Thu, 4 Nov 2010 16:25:39 +0000 (16:25 +0000)
src/lib-storage/index/istream-attachment.c

index 528dad400f08c5f67130fa2f65dde914c3998655..efcfa2c2ceac81e3fa93af53e172f5c884db4d71 100644 (file)
@@ -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) :