diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-03 16:28:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-03 23:33:20 +0100 |
commit | e5e7cb822a7d1beec3af5781dac275e441782632 (patch) | |
tree | 77680a7df328c31b7b297a531dab863ce954f499 /Kernel/Net/NetworkTask.cpp | |
parent | 2dc91865a4d96430081fed928009a8f65764a72b (diff) | |
download | serenity-e5e7cb822a7d1beec3af5781dac275e441782632.zip |
Kernel: Ignore allocation failures when trying to retransmit packets
We ignore allocation failures above the first 16 guaranteed socket
slots, as we will just retransmit their packets the next time around.
Diffstat (limited to 'Kernel/Net/NetworkTask.cpp')
-rw-r--r-- | Kernel/Net/NetworkTask.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp index 2b1dbcf3ca..e1d973af20 100644 --- a/Kernel/Net/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -651,7 +651,9 @@ void retransmit_tcp_packets() // in case retransmit_packets() realizes that it wants to close the socket. NonnullRefPtrVector<TCPSocket, 16> sockets; TCPSocket::sockets_for_retransmit().for_each_shared([&](const auto& socket) { - sockets.append(socket); + // We ignore allocation failures above the first 16 guaranteed socket slots, as + // we will just retransmit their packets the next time around + (void)sockets.try_append(socket); }); for (auto& socket : sockets) { |