mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
Kernel: Use timeval_sub for TCP retransmissions and lower timer to 500ms
This commit is contained in:
parent
3f1c3a341b
commit
c983e96664
Notes:
sideshowbarker
2024-07-19 12:11:27 +09:00
Author: https://github.com/deoxxa Commit: https://github.com/SerenityOS/serenity/commit/c983e966645 Pull-request: https://github.com/SerenityOS/serenity/pull/530 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <AK/Time.h>
|
||||
#include <Kernel/Devices/RandomDevice.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
|
@ -184,7 +185,9 @@ void TCPSocket::send_outgoing_packets()
|
|||
auto now = kgettimeofday();
|
||||
|
||||
for (auto& packet : m_not_acked) {
|
||||
if (now.tv_sec <= packet.tx_time.tv_sec)
|
||||
timeval diff;
|
||||
timeval_sub(packet.tx_time, now, diff);
|
||||
if (diff.tv_sec < 1 && diff.tv_usec <= 500000)
|
||||
continue;
|
||||
|
||||
packet.tx_time = now;
|
||||
|
|
Loading…
Add table
Reference in a new issue