From 93f656119cff56154e6c6125f3573859facf0c19 Mon Sep 17 00:00:00 2001 From: Vitaly Dyachkov Date: Tue, 15 Feb 2022 11:10:02 +0100 Subject: [PATCH] LibIPC: Always shutdown() the Connection if reached EOF --- Userland/Libraries/LibIPC/Connection.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibIPC/Connection.cpp b/Userland/Libraries/LibIPC/Connection.cpp index 54a805635e..e61b9dc801 100644 --- a/Userland/Libraries/LibIPC/Connection.cpp +++ b/Userland/Libraries/LibIPC/Connection.cpp @@ -138,11 +138,8 @@ ErrorOr> ConnectionBase::read_as_much_as_possible_from_socket_without auto nread = maybe_nread.release_value(); if (nread == 0) { - if (bytes.is_empty()) { - deferred_invoke([this] { shutdown(); }); - return Error::from_string_literal("IPC connection EOF"sv); - } - break; + deferred_invoke([this] { shutdown(); }); + return Error::from_string_literal("IPC connection EOF"sv); } bytes.append(buffer, nread);