mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Streams: Consistent behaviour when reading from stream with error.
The streaming operator doesn't short-circuit, consider the following
snippet:
void foo(InputStream& stream) {
int a, b;
stream >> a >> b;
}
If the first read fails, the second is called regardless. It should be
well defined what happens in this case: nothing.
This commit is contained in:
@@ -189,8 +189,8 @@ DeflateDecompressor::~DeflateDecompressor()
|
||||
|
||||
size_t DeflateDecompressor::read(Bytes bytes)
|
||||
{
|
||||
// FIXME: There are surely a ton of bugs because we don't check for read errors
|
||||
// very often.
|
||||
if (has_any_error())
|
||||
return 0;
|
||||
|
||||
if (m_state == State::Idle) {
|
||||
if (m_read_final_bock)
|
||||
|
||||
Reference in New Issue
Block a user