1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:07:34 +00:00

LibIPC: Always shutdown() the Connection if reached EOF

This commit is contained in:
Vitaly Dyachkov 2022-02-15 11:10:02 +01:00 committed by Andreas Kling
parent 8fea7d9752
commit 93f656119c

View file

@ -138,11 +138,8 @@ ErrorOr<Vector<u8>> ConnectionBase::read_as_much_as_possible_from_socket_without
auto nread = maybe_nread.release_value(); auto nread = maybe_nread.release_value();
if (nread == 0) { if (nread == 0) {
if (bytes.is_empty()) { deferred_invoke([this] { shutdown(); });
deferred_invoke([this] { shutdown(); }); return Error::from_string_literal("IPC connection EOF"sv);
return Error::from_string_literal("IPC connection EOF"sv);
}
break;
} }
bytes.append(buffer, nread); bytes.append(buffer, nread);