mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
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:
parent
3dee41e584
commit
45998fd2c0
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue