mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibIPC: Make TransportSocket responsible for reading entire messages
With this change, the responsibility for prepending messages with their size and ensuring the entire message is received before returning it to the caller is moved to TransportSocket. This removes the need to duplicate this logic in both LibIPC and MessagePort. Another advantage of reducing message granularity at IPC::Transport layer is that it will make it easier to support alternative transport implementations (like Mach ports, which unlike Unix domain sockets are not stream oriented).
This commit is contained in:
parent
0a58497ab9
commit
a371f849e3
Notes:
github-actions[bot]
2025-04-07 15:00:45 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: a371f849e3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4260
7 changed files with 130 additions and 204 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2024, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -51,9 +52,7 @@ protected:
|
|||
|
||||
OwnPtr<IPC::Message> wait_for_specific_endpoint_message_impl(u32 endpoint_magic, int message_id);
|
||||
void wait_for_transport_to_become_readable();
|
||||
ErrorOr<Vector<u8>> read_as_much_as_possible_from_transport_without_blocking();
|
||||
ErrorOr<void> drain_messages_from_peer();
|
||||
void try_parse_messages(Vector<u8> const& bytes, size_t& index);
|
||||
|
||||
void handle_messages();
|
||||
|
||||
|
@ -64,8 +63,6 @@ protected:
|
|||
RefPtr<Core::Timer> m_responsiveness_timer;
|
||||
|
||||
Vector<NonnullOwnPtr<Message>> m_unprocessed_messages;
|
||||
UnprocessedFileDescriptors m_unprocessed_fds;
|
||||
ByteBuffer m_unprocessed_bytes;
|
||||
|
||||
u32 m_local_endpoint_magic { 0 };
|
||||
u32 m_peer_endpoint_magic { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue