mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
report unexpected received packet size as an error
This commit is contained in:
parent
e89fd3e8cc
commit
5da4936e43
1 changed files with 3 additions and 1 deletions
|
@ -999,7 +999,9 @@ linux_relay_receive( CommonGlobals* cGlobals, unsigned char* buf, int bufSize )
|
||||||
unsigned short packetSize = ntohs( tmp );
|
unsigned short packetSize = ntohs( tmp );
|
||||||
assert( packetSize <= bufSize );
|
assert( packetSize <= bufSize );
|
||||||
nRead = blocking_read( sock, buf, packetSize );
|
nRead = blocking_read( sock, buf, packetSize );
|
||||||
if ( nRead == packetSize ) {
|
if ( nRead != packetSize ) {
|
||||||
|
nRead = -1;
|
||||||
|
} else {
|
||||||
LaunchParams* params = cGlobals->params;
|
LaunchParams* params = cGlobals->params;
|
||||||
++params->nPacketsRcvd;
|
++params->nPacketsRcvd;
|
||||||
if ( params->dropNthRcvd == 0 ) {
|
if ( params->dropNthRcvd == 0 ) {
|
||||||
|
|
Loading…
Reference in a new issue