don't assert when packet size short is unexpectedly large. Not sure

why this happens, but it's not a reason to abort a test.
This commit is contained in:
Eric House 2013-08-21 21:28:47 -07:00
parent 3dee41e584
commit 45998fd2c0

View file

@ -1220,8 +1220,12 @@ linux_relay_receive( CommonGlobals* cGlobals, unsigned char* buf, int bufSize )
} else {
unsigned short packetSize = ntohs( tmp );
XP_LOGF( "%s: got packet of size %d", __func__, packetSize );
assert( packetSize <= bufSize );
nRead = blocking_read( sock, buf, packetSize );
if ( packetSize > bufSize ) {
XP_LOGF( "%s: packet size %d TOO LARGE; closing socket", __func__, packetSize );
nRead = -1;
} else {
nRead = blocking_read( sock, buf, packetSize );
}
if ( nRead == packetSize ) {
LaunchParams* params = cGlobals->params;
++params->nPacketsRcvd;