mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibCore: Make CIODevice::read_all() actually read all data
It used to only read the data it could get without blocking. Andreas says this was intentional, but it's counterintuitive and no code that uses read_all() actually expects it to return only a part of the data. So change it to always read data until an EOF (or an error) is received.
This commit is contained in:
parent
cf04de188e
commit
cee597a728
Notes:
sideshowbarker
2024-07-19 10:00:41 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/cee597a728c Pull-request: https://github.com/SerenityOS/serenity/pull/1079 Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ ByteBuffer CIODevice::read_all()
|
|||
m_buffered_data.clear();
|
||||
}
|
||||
|
||||
while (can_read_from_fd()) {
|
||||
while (true) {
|
||||
char read_buffer[4096];
|
||||
int nread = ::read(m_fd, read_buffer, sizeof(read_buffer));
|
||||
if (nread < 0) {
|
||||
|
|
Loading…
Reference in a new issue