Skip to content

Commit

Permalink
Recheck relation size limit more often and with a smaller margin.
Browse files Browse the repository at this point in the history
This rechecks the relation block size every 200 elements instead of every 500, so should be more likely to catch overruns. It also only permits a 12.5% overrun of the "ideal" block length before flushing, which should limit the scope for reaching the error condition (100% overrun).
  • Loading branch information
zerebubuth committed Sep 18, 2022
1 parent d3180dc commit 3ed6a62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pbf_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct pbf_writer::pimpl {
: num_elements(0), buffer(), out(out_name.c_str()), str_table(),
pblock(), pgroup(pblock.add_primitivegroup()),
current_node(NULL), current_way(NULL), current_relation(NULL),
m_byte_limit(int(0.25 * OSMPBF::max_uncompressed_blob_size)),
m_byte_limit(int(0.125 * OSMPBF::max_uncompressed_blob_size)),
m_current_element(element_NULL),
m_last_way_node_ref(0),
m_last_relation_member_ref(0),
Expand All @@ -124,7 +124,7 @@ struct pbf_writer::pimpl {
m_recheck_elements[element_CHANGESET] = 1;
m_recheck_elements[element_NODE] = 16000;
m_recheck_elements[element_WAY] = 8000;
m_recheck_elements[element_RELATION] = 500;
m_recheck_elements[element_RELATION] = 200;

reset_dense_ids();

Expand Down

0 comments on commit 3ed6a62

Please sign in to comment.