mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibIPC: Check "unsent bytes" pointer while deciding whether to return
...unsent data back in the queue. This change should not fix any bugs, but allows to avoid unnecessary `return_unsent_data_to_front_of_queue()` calls.
This commit is contained in:
parent
9dbeecb73d
commit
fd784ddb15
1 changed files with 4 additions and 4 deletions
|
@ -63,16 +63,16 @@ TransportSocket::TransportSocket(NonnullOwnPtr<Core::LocalSocket> socket)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
auto [bytes, fds] = send_queue->dequeue(4096);
|
auto [bytes, fds] = send_queue->dequeue(4096);
|
||||||
ReadonlyBytes bytes_to_send = bytes;
|
ReadonlyBytes remaining_to_send_bytes = bytes;
|
||||||
|
|
||||||
auto result = send_message(*m_socket, bytes_to_send, fds);
|
auto result = send_message(*m_socket, remaining_to_send_bytes, fds);
|
||||||
if (result.is_error()) {
|
if (result.is_error()) {
|
||||||
dbgln("TransportSocket::send_thread: {}", result.error());
|
dbgln("TransportSocket::send_thread: {}", result.error());
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bytes.is_empty() || !fds.is_empty()) {
|
if (!remaining_to_send_bytes.is_empty() || !fds.is_empty()) {
|
||||||
send_queue->return_unsent_data_to_front_of_queue(bytes_to_send, fds);
|
send_queue->return_unsent_data_to_front_of_queue(remaining_to_send_bytes, fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue