Skip to content

Commit

Permalink
DEV9: Increase allowed number of to be ACKed tcp packets
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastRar authored and lightningterror committed Apr 8, 2024
1 parent 7903c7c commit 52ddb0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pcsx2/DEV9/Sessions/TCP_Session/TCP_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions pcsx2/DEV9/Sessions/TCP_Session/TCP_Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 3 additions & 2 deletions pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 52ddb0e

Please sign in to comment.