streaming/api: fix overlap check

In some cases a SBB could be seen as overlapping with the requested
offset, when it was in fact precisely before it. In some special cases
this could lead to the stream engine not progressing the 'raw' progress.
pull/4492/head
Victor Julien 6 years ago
parent 0f41cf3d74
commit 2c050187a3

@ -70,7 +70,7 @@ static inline int InclusiveCompare(StreamingBufferBlock *lookup, StreamingBuffer
const uint64_t tre = intree->offset + intree->len;
if (lre <= intree->offset) // entirely before
return -1;
else if (lre >= intree->offset && lre <= tre) // (some) overlap
else if (lre >= intree->offset && lookup->offset < tre && lre <= tre) // (some) overlap
return 0;
else
return 1; // entirely after

Loading…
Cancel
Save