mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +00:00
IPCCompiler: Make the connection shut down if the peer disconnected
If we know that the peer disconnected while receiving a message in the generated code, let's shutdown the connection from here instead of forcing each client to do so.
This commit is contained in:
parent
e56eb11dee
commit
4e9e340d21
Notes:
sideshowbarker
2024-07-17 02:05:41 +09:00
Author: https://github.com/LucasChollet
Commit: 4e9e340d21
Pull-request: https://github.com/SerenityOS/serenity/pull/22066
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 2 deletions
|
@ -514,8 +514,10 @@ void do_message_for_proxy(SourceGenerator message_generator, Endpoint const& end
|
|||
message_generator.append(";");
|
||||
} else if (is_try) {
|
||||
message_generator.append(R"~~~();
|
||||
if (!result)
|
||||
return IPC::ErrorCode::PeerDisconnected;)~~~");
|
||||
if (!result) {
|
||||
m_connection.shutdown();
|
||||
return IPC::ErrorCode::PeerDisconnected;
|
||||
})~~~");
|
||||
if (inner_return_type != "void") {
|
||||
message_generator.appendln(R"~~~(
|
||||
return move(*result);)~~~");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue