]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: If i_stream_default_seek_nonseekable() can't seek, set a more readable error...
authorTimo Sirainen <tss@iki.fi>
Mon, 29 Sep 2014 19:43:44 +0000 (22:43 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 29 Sep 2014 19:43:44 +0000 (22:43 +0300)
src/lib/istream.c

index 648927bafa5dc512590f18b0934c87db7e7bf9ae..2ef0c2d514de54826ef54473a46c1c6cdb8fe824 100644 (file)
@@ -745,6 +745,11 @@ void i_stream_default_seek_nonseekable(struct istream_private *stream,
 
                available = stream->pos - stream->skip;
                if (available == 0) {
+                       io_stream_set_error(&stream->iostream,
+                               "Can't seek to offset %"PRIuUOFF_T
+                               ", because we have data only up to offset %"
+                               PRIuUOFF_T" (eof=%d)", v_offset,
+                               stream->istream.v_offset, stream->istream.eof);
                        stream->istream.stream_errno = ESPIPE;
                        return;
                }