From ee083c411c87234d814fbc37331c20ba773978e7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 4 Nov 2010 14:07:30 +0000 Subject: [PATCH] istream-attachment: Removed parent stream's size sanity check. It didn't work right with base64 streams. --- src/lib-storage/index/istream-attachment.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib-storage/index/istream-attachment.c b/src/lib-storage/index/istream-attachment.c index f82afb3348..528dad400f 100644 --- a/src/lib-storage/index/istream-attachment.c +++ b/src/lib-storage/index/istream-attachment.c @@ -81,24 +81,21 @@ i_stream_attachment_seek(struct istream_private *stream, } static const struct stat * -i_stream_attachment_stat(struct istream_private *stream, bool exact) +i_stream_attachment_stat(struct istream_private *stream, bool exact ATTR_UNUSED) { struct attachment_istream *astream = (struct attachment_istream *)stream; const struct stat *st; - st = i_stream_stat(stream->parent, exact); + /* parent stream may be base64-decoder. don't waste time decoding the + entire stream, since we already know what the size is supposed + to be. */ + st = i_stream_stat(stream->parent, FALSE); if (st == NULL) return NULL; stream->statbuf = *st; stream->statbuf.st_size = astream->size; - if (st->st_size != 0 && (uoff_t)st->st_size != astream->size) { - i_error("Attachment file %s size mismatch: " - "%"PRIuUOFF_T" != %"PRIuUOFF_T, - i_stream_get_name(stream->parent), - st->st_size, astream->size); - } return &stream->statbuf; } -- 2.47.3