mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibIPC: Process remaining read bytes before shutting down due to EOF
Previously we would shut down an ipc connection regardless of if there were still bytes that have been read and not been handed over to processing, causing WindowServer not to receive WindowServer::SetFlashFlush messages sent by `wsctl -f` except the first one. This patch fixes that behavior by still shutting the connection down due to having reached EOF while also processing remaining bytes. Resolves #12954 See also #8912 which fixes the same issue that this patch fixes but also seems to have initially broken SettingsWindow cancel not actually closing the window unless the cursor got moved as described in #12003. Pull request #12547 fixing the SettingsWindow behavior broke `wsctl` again by always shutting down.
This commit is contained in:
parent
a705741be3
commit
b0461c1522
1 changed files with 2 additions and 0 deletions
|
@ -136,6 +136,8 @@ ErrorOr<Vector<u8>> ConnectionBase::read_as_much_as_possible_from_socket_without
|
|||
auto bytes_read = maybe_bytes_read.release_value();
|
||||
if (bytes_read.is_empty()) {
|
||||
deferred_invoke([this] { shutdown(); });
|
||||
if (!bytes.is_empty())
|
||||
break;
|
||||
return Error::from_string_literal("IPC connection EOF"sv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue