Otherwise we might not get enough data to decompress
the stream.
#include "compression.h"
#include "fs-api-private.h"
+#define FS_COMPRESS_ISTREAM_MIN_BUFFER_SIZE 1024
+
struct compress_fs {
struct fs fs;
const struct compression_handler *compress_handler;
return file->input;
}
- input = fs_read_stream(file->super_read, max_buffer_size);
+ input = fs_read_stream(file->super_read,
+ I_MAX(FS_COMPRESS_ISTREAM_MIN_BUFFER_SIZE, max_buffer_size));
if (file->fs->try_plain)
flags |= ISTREAM_DECOMPRESS_FLAG_TRY;
file->input = i_stream_create_decompress(input, flags);