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) if (size)
{ {
BufferBase::set(impl->buffer().begin(), impl->buffer().size(), impl->offset()); BufferBase::set(impl->buffer().begin(), impl->buffer().size(), impl->offset());
prefetch_future = {}; impl->absolute_position += working_buffer.size();
} }
prefetch_future = {};
return size; return size;
} }

View File

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

View File

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