Mercurial > dovecot > core-2.2
changeset 2434:5e8e41cb8185 HEAD
Keep track of offset.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 22 Aug 2004 08:46:50 +0300 |
parents | be3338893a56 |
children | 288eb0d0ca7d |
files | src/lib/ostream-crlf.c |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/ostream-crlf.c Sun Aug 22 08:04:16 2004 +0300 +++ b/src/lib/ostream-crlf.c Sun Aug 22 08:46:50 2004 +0300 @@ -63,9 +63,12 @@ static int _seek(struct _ostream *stream, uoff_t offset) { struct crlf_ostream *cstream = (struct crlf_ostream *)stream; + int ret; cstream->last_cr = FALSE; - return o_stream_seek(cstream->output, offset); + ret = o_stream_seek(cstream->output, offset); + stream->ostream.offset = cstream->output->offset; + return ret; } static ssize_t sendv_crlf(struct crlf_ostream *cstream, @@ -84,6 +87,7 @@ cstream->last_cr = *((const char *)iov->iov_base + pos) == '\r'; } + cstream->ostream.ostream.offset = cstream->output->offset; return ret; } @@ -204,6 +208,8 @@ if (new_iov_count == IOVBUF_COUNT) { ret = o_stream_sendv(cstream->output, buf->data, new_iov_count); + stream->ostream.offset = + cstream->output->offset; if (ret != (ssize_t)new_iov_size) { t_pop(); return ret; @@ -220,6 +226,8 @@ } ret = o_stream_sendv(cstream->output, buf->data, new_iov_count); + stream->ostream.offset = cstream->output->offset; + t_pop(); return ret; }