Skip to content

Commit

Permalink
lib-fs: ostream-metawrap: Fixed o_stream_send_istream() offset updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed May 18, 2016
1 parent a067446 commit fbae84c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib-fs/ostream-metawrap.c
@@ -1,6 +1,7 @@
/* 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"

Expand Down Expand Up @@ -43,14 +44,13 @@ o_stream_metawrap_send_istream(struct ostream_private *_outstream,
{
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;
}

Expand Down

0 comments on commit fbae84c

Please sign in to comment.