mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibIPC+Meta: Keep message buffer alive until acknowledged by peer
This change ensures that instead of immediately deallocating the message buffer after sending, we retain it in an acknowledgement wait queue until an acknowledgement is received from the peer. This is necessary to handle a behavior of the macOS kernel, which may prematurely garbage-collect file descriptors contained within the message buffer before the peer receives them. The acknowledgement mechanism assumes messages are received in the same order they were sent so, each acknowledgement message simply indicates the count of successfully received messages, specifying how many entries can safely be removed from the acknowledgement wait queue.
This commit is contained in:
parent
15e2c78e9a
commit
c3121c9d8a
Notes:
github-actions[bot]
2025-04-05 21:15:26 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: c3121c9d8a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4230
5 changed files with 121 additions and 16 deletions
|
@ -760,6 +760,8 @@ public:
|
|||
generator.append(R"~~~(
|
||||
case (int)IPC::LargeMessageWrapper::MESSAGE_ID:
|
||||
return TRY(IPC::LargeMessageWrapper::decode(message_endpoint_magic, stream, files));
|
||||
case (int)IPC::Acknowledgement::MESSAGE_ID:
|
||||
return TRY(IPC::Acknowledgement::decode(message_endpoint_magic, stream, files));
|
||||
)~~~");
|
||||
|
||||
generator.append(R"~~~(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue