mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
committed by
Andreas Kling
parent
15e2c78e9a
commit
c3121c9d8a
Notes:
github-actions[bot]
2025-04-05 21:15:26 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/c3121c9d8ad Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4230
@@ -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"~~~(
|
||||
|
||||
Reference in New Issue
Block a user