DEV9: Increase allowed number of to be ACKed tcp packets

This commit is contained in:
TheLastRar 2024-04-06 20:41:51 +01:00 committed by lightningterror
parent 7903c7c17e
commit 52ddb0efd9
3 changed files with 9 additions and 2 deletions

View File

@ -55,6 +55,11 @@ namespace Sessions
std::lock_guard numberlock(myNumberSentry);
return GetDelta(_MySequenceNumber, _ReceivedAckNumber);
}
bool TCP_Session::ShouldWaitForAck()
{
std::lock_guard numberlock(myNumberSentry);
return _OldMyNumbers[0] == _ReceivedAckNumber;
}
std::tuple<u32, std::vector<u32>> TCP_Session::GetAllMyNumbers()
{
std::lock_guard numberlock(myNumberSentry);

View File

@ -93,6 +93,7 @@ namespace Sessions
void UpdateReceivedAckNumber(u32 ack);
u32 GetMyNumber();
u32 GetOutstandingSequenceLength();
bool ShouldWaitForAck();
std::tuple<u32, std::vector<u32>> GetAllMyNumbers();
void ResetMyNumbers();

View File

@ -67,6 +67,8 @@ namespace Sessions
return nullptr;
}
if (ShouldWaitForAck())
return nullptr;
//Note, windowSize will be updated before _ReceivedAckNumber, potential race condition
//in practice, we just get a smaller or -ve maxSize
@ -78,8 +80,7 @@ namespace Sessions
else
maxSize = std::min<int>(maxSegmentSize, windowSize.load() - outstanding);
if (maxSize > 0 &&
myNumberACKed.load())
if (maxSize > 0)
{
std::unique_ptr<u8[]> buffer;
int err = 0;