stream: fix cache::read() to return state_t::eof correctly
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
91ffe3f633
commit
7eba65813e
@ -1911,10 +1911,14 @@ namespace stdex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
load_cache(m_offset);
|
load_cache(m_offset);
|
||||||
if (!ok() || m_cache.region.end <= m_offset) _Unlikely_ {
|
if (!ok()) _Unlikely_ {
|
||||||
m_state = to_read < length ? state_t::ok : state_t::fail;
|
m_state = to_read < length ? state_t::ok : state_t::fail;
|
||||||
return length - to_read;
|
return length - to_read;
|
||||||
}
|
}
|
||||||
|
if (m_cache.region.end <= m_offset) _Unlikely_ {
|
||||||
|
m_state = to_read < length ? state_t::ok : state_t::eof;
|
||||||
|
return length - to_read;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user