mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
'CNetConBase::Recv' cleanup
This commit is contained in:
parent
9829684183
commit
d56c24ce05
@ -90,9 +90,9 @@ void CNetConBase::Recv(CConnectedNetConsoleData* pData, const int nMaxLen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (nPendingLen <= 0) // EOF or error.
|
||||
else if (nPendingLen == 0) // Socket was closed.
|
||||
{
|
||||
Disconnect("unexpected EOF or error");
|
||||
Disconnect("remote closed socket");
|
||||
return;
|
||||
}
|
||||
}//////////////////////////////////////////////
|
||||
@ -106,8 +106,6 @@ void CNetConBase::Recv(CConnectedNetConsoleData* pData, const int nMaxLen)
|
||||
return;
|
||||
}
|
||||
|
||||
bool bSuccess = true;
|
||||
|
||||
while (nReadLen > 0)
|
||||
{
|
||||
const int nRecvLen = ::recv(pData->m_hSocket, szRecvBuf, MIN(sizeof(szRecvBuf), nReadLen), MSG_NOSIGNAL);
|
||||
@ -123,10 +121,7 @@ void CNetConBase::Recv(CConnectedNetConsoleData* pData, const int nMaxLen)
|
||||
}
|
||||
|
||||
nReadLen -= nRecvLen; // Process what we've got.
|
||||
if (!ProcessBuffer(pData, szRecvBuf, nRecvLen, nMaxLen) && bSuccess)
|
||||
{
|
||||
bSuccess = false;
|
||||
}
|
||||
ProcessBuffer(pData, szRecvBuf, nRecvLen, nMaxLen);
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user