diff options
author | Conrad Pankoff <deoxxa@fknsrs.biz> | 2019-09-08 19:40:26 +1000 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-08 12:34:20 +0200 |
commit | c983e966645d292594284c8fca29a4b4ae225e82 (patch) | |
tree | 4bdcb80a410075ab929c8f69f48da440374ab1f9 /Kernel | |
parent | 3f1c3a341b396fefd2fa27afcbfb10eaec4dca70 (diff) | |
download | serenity-c983e966645d292594284c8fca29a4b4ae225e82.zip |
Kernel: Use timeval_sub for TCP retransmissions and lower timer to 500ms
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Net/TCPSocket.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Kernel/Net/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp index 7d411152b8..8f3c15cb5e 100644 --- a/Kernel/Net/TCPSocket.cpp +++ b/Kernel/Net/TCPSocket.cpp @@ -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; |