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.
This commit is contained in:
Augustin Cavalier
2024-01-29 16:05:54 -05:00
parent 0382176581
commit c4f37b0017
@@ -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) {