1
0

ProtoProxy: Fixed handling of incomplete packets.

This commit is contained in:
madmaxoft 2013-11-02 17:46:37 +01:00
parent 9bdc94053e
commit 0652e7a4c8

View File

@ -718,6 +718,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size)
) )
{ {
// Not a complete packet yet // Not a complete packet yet
m_ServerBuffer.ResetRead();
break; break;
} }
UInt32 PacketType, PacketReadSoFar; UInt32 PacketType, PacketReadSoFar;
@ -2683,6 +2684,7 @@ bool cConnection::HandleServerWindowOpen(void)
bool cConnection::HandleServerUnknownPacket(UInt32 a_PacketType, UInt32 a_PacketLen, UInt32 a_PacketReadSoFar) bool cConnection::HandleServerUnknownPacket(UInt32 a_PacketType, UInt32 a_PacketLen, UInt32 a_PacketReadSoFar)
{ {
AString Data; AString Data;
ASSERT(a_PacketLen >= a_PacketReadSoFar);
if (!m_ServerBuffer.ReadString(Data, a_PacketLen - a_PacketReadSoFar)) if (!m_ServerBuffer.ReadString(Data, a_PacketLen - a_PacketReadSoFar))
{ {
return false; return false;