mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +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
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