From c4f37b001722abef56e1a40e8c73b32eff226c9e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 29 Jan 2024 16:05:54 -0500 Subject: [PATCH] TCP: Initiate a send before waiting in SendData(). Otherwise, we will sit around here waiting forever, with the send queue full but nothing actually sending data. --- src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp index ca0f4e6525..0be66f7e1e 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp +++ b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp @@ -837,6 +837,10 @@ TCPEndpoint::SendData(net_buffer *buffer) while (left > 0) { while (fSendQueue.Free() < socket->send.low_water_mark) { + // initiate a send before waiting + if (fState == ESTABLISHED || fState == FINISH_RECEIVED) + _SendQueued(); + // wait until enough space is available status_t status = _WaitForCondition(fSendCondition, lock, timeout); if (status < B_OK) {