mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +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 {
|
} else {
|
||||||
unsigned short packetSize = ntohs( tmp );
|
unsigned short packetSize = ntohs( tmp );
|
||||||
XP_LOGF( "%s: got packet of size %d", __func__, packetSize );
|
XP_LOGF( "%s: got packet of size %d", __func__, packetSize );
|
||||||
assert( packetSize <= bufSize );
|
if ( packetSize > bufSize ) {
|
||||||
|
XP_LOGF( "%s: packet size %d TOO LARGE; closing socket", __func__, packetSize );
|
||||||
|
nRead = -1;
|
||||||
|
} else {
|
||||||
nRead = blocking_read( sock, buf, packetSize );
|
nRead = blocking_read( sock, buf, packetSize );
|
||||||
|
}
|
||||||
if ( nRead == packetSize ) {
|
if ( nRead == packetSize ) {
|
||||||
LaunchParams* params = cGlobals->params;
|
LaunchParams* params = cGlobals->params;
|
||||||
++params->nPacketsRcvd;
|
++params->nPacketsRcvd;
|
||||||
|
|
Loading…
Add table
Reference in a new issue