mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibIPC: Clear sent fds vector along with sent bytes in TransportSocket
It was a bit confusing we had two different places where we clear/advance buffer positions after successfull send.
This commit is contained in:
parent
69f3f74f39
commit
9eff98c6a2
1 changed files with 2 additions and 4 deletions
|
@ -170,10 +170,6 @@ ErrorOr<void> TransportSocket::send_message(Core::LocalSocket& socket, ReadonlyB
|
|||
ErrorOr<ssize_t> maybe_nwritten = 0;
|
||||
if (num_fds_to_transfer > 0) {
|
||||
maybe_nwritten = socket.send_message(bytes_to_write, 0, unowned_fds);
|
||||
if (!maybe_nwritten.is_error()) {
|
||||
num_fds_to_transfer = 0;
|
||||
unowned_fds.clear();
|
||||
}
|
||||
} else {
|
||||
maybe_nwritten = socket.write_some(bytes_to_write);
|
||||
}
|
||||
|
@ -187,6 +183,8 @@ ErrorOr<void> TransportSocket::send_message(Core::LocalSocket& socket, ReadonlyB
|
|||
}
|
||||
|
||||
bytes_to_write = bytes_to_write.slice(maybe_nwritten.value());
|
||||
unowned_fds.clear();
|
||||
num_fds_to_transfer = 0;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue