This commit is contained in:
kssenii 2021-09-21 02:25:50 +03:00
parent 0104cb1c8e
commit cacc81ca61
3 changed files with 6 additions and 5 deletions

View File

@ -78,9 +78,10 @@ bool AsynchronousReadIndirectBufferFromRemoteFS::nextImpl()
if (size)
{
BufferBase::set(impl->buffer().begin(), impl->buffer().size(), impl->offset());
prefetch_future = {};
impl->absolute_position += working_buffer.size();
}
prefetch_future = {};
return size;
}

View File

@ -64,6 +64,9 @@ bool ReadIndirectBufferFromRemoteFS::nextImpl()
/// and assigned to current buffer.
swap(*impl);
if (result)
impl->absolute_position += working_buffer.size();
return result;
}

View File

@ -75,10 +75,7 @@ bool ReadBufferFromRemoteFS::readImpl()
auto result = current_buf->next();
/// Assign result to current buffer.
swap(*current_buf);
/// absolute position is shifted by a data size that was read in next() call above.
if (result)
absolute_position += working_buffer.size();
/// Absolute position is updated by *IndirectBufferFromRemoteFS only.
return result;
}