diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-02-02 19:09:05 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-06 13:10:10 +0100 |
commit | 7a95c451a3bc4eb379e12c8243b878f73a3dd03d (patch) | |
tree | a4bd2a164f2e34cd5d02002fdefd687d9d32937a /Userland/Libraries/LibCore | |
parent | 9ee5107871d129abcc97fb8fd24510417caf9072 (diff) | |
download | serenity-7a95c451a3bc4eb379e12c8243b878f73a3dd03d.zip |
LibCore: Stop buffering when a zero-size slice is read regardless of EOF
The meaning of EOF depends on the underlying socket, but an empty slice
should terminate the buffering (otherwise we'd just spin forever).
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r-- | Userland/Libraries/LibCore/Stream.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/Stream.h b/Userland/Libraries/LibCore/Stream.h index b074fe8ded..dceb631de8 100644 --- a/Userland/Libraries/LibCore/Stream.h +++ b/Userland/Libraries/LibCore/Stream.h @@ -664,6 +664,9 @@ public: if (populated_slice.contains_slow('\n')) return true; + + if (populated_slice.is_empty()) + break; } return false; |