mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +00:00
LibIPC: Move early fd deallocation workaround to the transport layer
Reimplements c3121c9d
at the transport layer, allowing us to solve the
same problem once, in a single place, for both the LibIPC connection and
MessagePort. This avoids exposing a workaround for a macOS specific Unix
domain socket issue to higher abstraction layers.
This commit is contained in:
parent
3525467e56
commit
ab35325003
Notes:
github-actions[bot]
2025-04-08 19:10:45 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: ab35325003
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4276
Reviewed-by: https://github.com/ADKaster
7 changed files with 78 additions and 128 deletions
|
@ -7,7 +7,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Queue.h>
|
||||
#include <LibIPC/UnprocessedFileDescriptors.h>
|
||||
#include <LibThreading/MutexProtected.h>
|
||||
|
||||
namespace IPC {
|
||||
|
||||
|
@ -48,8 +50,14 @@ private:
|
|||
ErrorOr<void> transfer(ReadonlyBytes, Vector<int, 1> const& unowned_fds);
|
||||
|
||||
NonnullOwnPtr<Core::LocalSocket> m_socket;
|
||||
NonnullOwnPtr<Threading::Mutex> m_socket_write_mutex;
|
||||
ByteBuffer m_unprocessed_bytes;
|
||||
UnprocessedFileDescriptors m_unprocessed_fds;
|
||||
|
||||
// After file descriptor is sent, it is moved to the wait queue until an acknowledgement is received from the peer.
|
||||
// This is necessary to handle a specific behavior of the macOS kernel, which may prematurely garbage-collect the file
|
||||
// descriptor contained in the message before the peer receives it. https://openradar.me/9477351
|
||||
NonnullOwnPtr<Threading::MutexProtected<Queue<File>>> m_fds_retained_until_received_by_peer;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue