/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
+#include "istream.h"
#include "ostream-private.h"
#include "ostream-metawrap.h"
{
struct metawrap_ostream *outstream =
(struct metawrap_ostream *)_outstream;
- uoff_t orig_outstream_offset = _outstream->ostream.offset;
+ uoff_t orig_instream_offset = instream->v_offset;
int ret;
o_stream_metawrap_call_callback(outstream);
if ((ret = o_stream_send_istream(_outstream->parent, instream)) < 0)
o_stream_copy_error_from_parent(_outstream);
- _outstream->ostream.offset +=
- _outstream->ostream.offset - orig_outstream_offset;
+ _outstream->ostream.offset += instream->v_offset - orig_instream_offset;
return ret;
}