Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/osmium/io/detail/pbf_input_format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ namespace osmium {
if (!osmium::io::detail::read_exactly(m_fd, buffer.data(), static_cast<unsigned int>(buffer.size()))) {
return 0; // EOF
}

if (m_offset_ptr) {
*m_offset_ptr += buffer.size();
}

return check_size(get_size_in_network_byte_order(buffer.data()));
}

Expand Down Expand Up @@ -210,6 +215,10 @@ namespace osmium {
if (!osmium::io::detail::read_exactly(m_fd, &*buffer.begin(), static_cast<unsigned int>(size))) {
throw osmium::pbf_error{"unexpected EOF"};
}

if (m_offset_ptr) {
*m_offset_ptr += buffer.size();
}
} else {
ensure_available_in_input_queue(size);
buffer.append(m_input_buffer, 0, size);
Expand Down
Loading