Skip to content

Commit

Permalink
Fix handling of empty STK layers (question of why these exist remains) (
Browse files Browse the repository at this point in the history
#88)

It's a bit surprising that this would be the check that works, but sounds good. I'm guessing the empty STK layers were happening because we create a header without checking how many updates are available. If there are no updates, we should probably resize the file to remove the past header (or if it hasn't been written, then simply don't write the head to the file because the updates.size was 0)
  • Loading branch information
dskyle authored and jredmondson committed Sep 22, 2018
1 parent 7075e05 commit 222d0f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/madara/knowledge/CheckpointPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ std::pair<std::string, KnowledgeRecord> CheckpointReader::next()
"decode () returned a negative encoding size. Bad filter/encode.");
}

if (buffer_remaining <= (int64_t)
if (buffer_remaining < (int64_t)
transport::MessageHeader::static_encoded_size ())
{
stage = 9;
Expand Down

0 comments on commit 222d0f5

Please sign in to comment.