This allows the read() implementation to read data into the existing
memarea. Otherwise a new memarea might have to be created because the old
one is referenced by the snapshot.
}
#endif
- _stream->prev_snapshot =
- _stream->snapshot(_stream, _stream->prev_snapshot);
+ if (_stream->skip != _stream->pos || _stream->prev_snapshot != NULL) {
+ _stream->prev_snapshot =
+ _stream->snapshot(_stream, _stream->prev_snapshot);
+ }
ret = i_stream_read_memarea(stream);
if (ret > 0)
i_stream_snapshot_free(&_stream->prev_snapshot);