From ff978b1ce3486088c19c31b63a4f7fc55cdf48ae Mon Sep 17 00:00:00 2001 From: Z8Griz <154282263+Z8Griz@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:34:11 -0600 Subject: [PATCH] RECEIVE WINDOW is different than RECEIVE BUFFER The receive buffer is allocated per socket. TCP receive buffer holds TCP data that has not yet been processed (consumed via read/recv system calls) by the application. --- src/Home/Net/Protocols/TCP/TCP.HH | 2 ++ src/Home/Net/Protocols/TCP/TCP.ZC | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Home/Net/Protocols/TCP/TCP.HH b/src/Home/Net/Protocols/TCP/TCP.HH index e24c7f36..f76ae553 100755 --- a/src/Home/Net/Protocols/TCP/TCP.HH +++ b/src/Home/Net/Protocols/TCP/TCP.HH @@ -11,6 +11,8 @@ U16 RECEIVE_WINDOW; // gets host window size. It is not static. U16 SEND_WINDOW; // gets receive window size from host, then adjust accordingly. +U32 RECEIVE_BUFFER; // is 32 too much? receive_buffer holds TCP data that has not yet been processed + #define TCP_MSS 536 // Max Segment Size default #define TCP_TIMEOUT 5000 diff --git a/src/Home/Net/Protocols/TCP/TCP.ZC b/src/Home/Net/Protocols/TCP/TCP.ZC index 77bc836b..22e4edcc 100755 --- a/src/Home/Net/Protocols/TCP/TCP.ZC +++ b/src/Home/Net/Protocols/TCP/TCP.ZC @@ -647,8 +647,8 @@ CTCPSocket TCPSocket(U16 domain=AF_UNSPEC) QueueInit(accept_queue); // init pending connection queue tcp_socket->accept_queue = accept_queue; - tcp_socket->receive_buffer_size = RECEIVE_WINDOW; - tcp_socket->receive_buffer = CAlloc(RECEIVE_WINDOW); + tcp_socket->receive_buffer_size = RECEIVE_BUFFER; + tcp_socket->receive_buffer = CAlloc(RECEIVE_BUFFER); tcp_socket->max_segment_size = TCP_MSS;