mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Kernel: Fix panic for Nagel's algorithm
It seems like the current implementation returns 0 in case we do not have enough data for a whole packet yet. The 0 value gets propagated to the return value of the syscall which according to the spec should return non-zero values for non-errors cases. This causes panic, as there is a VERIFY guard checking that more than > 0 bytes are written if no error has occurred.
This commit is contained in:
parent
dcbb8cf0ac
commit
2bec281ddc
Notes:
sideshowbarker
2024-07-17 07:43:05 +09:00
Author: https://github.com/UkuLoskit Commit: https://github.com/SerenityOS/serenity/commit/2bec281ddc Pull-request: https://github.com/SerenityOS/serenity/pull/21787 Issue: https://github.com/SerenityOS/serenity/issues/21320
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ ErrorOr<size_t> TCPSocket::protocol_send(UserOrKernelBuffer const& data, size_t
|
|||
// FIXME: Make this configurable via TCP_NODELAY.
|
||||
auto has_unacked_data = m_unacked_packets.with_shared([&](auto const& packets) { return packets.size > 0; });
|
||||
if (has_unacked_data && data_length < mss)
|
||||
return 0;
|
||||
return set_so_error(EAGAIN);
|
||||
|
||||
data_length = min(data_length, mss);
|
||||
TRY(send_tcp_packet(TCPFlags::PSH | TCPFlags::ACK, &data, data_length, &routing_decision));
|
||||
|
|
Loading…
Add table
Reference in a new issue