]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
istream-attachment: Removed parent stream's size sanity check. It didn't work right...
authorTimo Sirainen <tss@iki.fi>
Thu, 4 Nov 2010 14:07:30 +0000 (14:07 +0000)
committerTimo Sirainen <tss@iki.fi>
Thu, 4 Nov 2010 14:07:30 +0000 (14:07 +0000)
src/lib-storage/index/istream-attachment.c

index f82afb33483c5113e5193522c2ebcd057a4ff244..528dad400f08c5f67130fa2f65dde914c3998655 100644 (file)
@@ -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;
 }