mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-17 10:26:48 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/b0461c1522 Pull-request: https://github.com/SerenityOS/serenity/pull/14194 Issue: https://github.com/SerenityOS/serenity/issues/12954
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…
Reference in a new issue