allow window updates to be sent after consuming data from the receive buffer. This fixes an issue where people were experiencing hangs in TCP downloads.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20777 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -666,11 +666,17 @@ TCPEndpoint::ReadData(size_t numBytes, uint32 flags, net_buffer** _buffer)
|
|||||||
if (numBytes < fReceiveQueue.Available())
|
if (numBytes < fReceiveQueue.Available())
|
||||||
fReceiveList.Signal();
|
fReceiveList.Signal();
|
||||||
|
|
||||||
ssize_t receivedBytes = fReceiveQueue.Get(numBytes,
|
bool clone = (flags & MSG_PEEK);
|
||||||
(flags & MSG_PEEK) == 0, _buffer);
|
|
||||||
|
ssize_t receivedBytes = fReceiveQueue.Get(numBytes, !clone, _buffer);
|
||||||
|
|
||||||
TRACE(" ReadData(): %lu bytes kept.", fReceiveQueue.Available());
|
TRACE(" ReadData(): %lu bytes kept.", fReceiveQueue.Available());
|
||||||
|
|
||||||
|
if (!clone) {
|
||||||
|
// we are opening the window, check if we should send an ACK
|
||||||
|
_SendQueued();
|
||||||
|
}
|
||||||
|
|
||||||
return receivedBytes;
|
return receivedBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user