summaryrefslogtreecommitdiff
path: root/Kernel/Net/TCPSocket.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-08 01:43:55 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-08 01:45:45 +0100
commit6be880bd10dce91114706704aa8f1f27bbdce89f (patch)
treea72d4562a391ccebcc611f11bd6986bef860ceb7 /Kernel/Net/TCPSocket.cpp
parenta7e72f78cd8fe4c2e265dd03c1050dbf4f9c37b9 (diff)
downloadserenity-6be880bd10dce91114706704aa8f1f27bbdce89f.zip
IPv4: Send TCP packets right away instead of waiting to "retry"
Also be more explicit about zero-initializing OutgoingPacket objects.
Diffstat (limited to 'Kernel/Net/TCPSocket.cpp')
-rw-r--r--Kernel/Net/TCPSocket.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Kernel/Net/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp
index 0ab25c643d..8e114ddfa5 100644
--- a/Kernel/Net/TCPSocket.cpp
+++ b/Kernel/Net/TCPSocket.cpp
@@ -190,7 +190,7 @@ void TCPSocket::send_tcp_packet(u16 flags, const void* payload, size_t payload_s
if (tcp_packet.has_syn() || payload_size > 0) {
LOCKER(m_not_acked_lock);
- m_not_acked.append({ m_sequence_number, move(buffer), 0, {} });
+ m_not_acked.append({ m_sequence_number, move(buffer) });
send_outgoing_packets();
return;
}
@@ -217,9 +217,8 @@ void TCPSocket::send_outgoing_packets()
for (auto& packet : m_not_acked) {
timeval diff;
timeval_sub(packet.tx_time, now, diff);
- if (diff.tv_sec < 1 && diff.tv_usec <= 500000)
+ if (diff.tv_sec == 0 && diff.tv_usec <= 500000)
continue;
-
packet.tx_time = now;
packet.tx_counter++;