From afc2b4d4766b0e4ee8519ac6fcd98353d3864322 Mon Sep 17 00:00:00 2001
From: Anton Kling <anton@kling.gg>
Date: Thu, 4 Jul 2024 20:09:51 +0200
Subject: TCP: Allow delay for sends

This is not at all optimal for applications that already buffer their
data but can have a huge impact on those that don't. Applications that
don't wish to use this should disable this for their socket.
---
 kernel/network/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'kernel/network')

diff --git a/kernel/network/tcp.c b/kernel/network/tcp.c
index acdbdb3..6bec93e 100644
--- a/kernel/network/tcp.c
+++ b/kernel/network/tcp.c
@@ -288,7 +288,7 @@ void handle_tcp(ipv4_t src_ip, ipv4_t dst_ip, const u8 *payload,
     }
     if (tcp_payload_length > 0) {
       if (tcp_payload_length > ringbuffer_unused(&con->incoming_buffer)) {
-        return;
+        break;
       }
       int rc = ringbuffer_write(&con->incoming_buffer, tcp_payload,
                                 tcp_payload_length);
-- 
cgit v1.2.3