report unexpected received packet size as an error

This commit is contained in:
Eric House 2013-06-17 06:42:21 -07:00
parent e89fd3e8cc
commit 5da4936e43

View file

@ -999,7 +999,9 @@ linux_relay_receive( CommonGlobals* cGlobals, unsigned char* buf, int bufSize )
unsigned short packetSize = ntohs( tmp );
assert( packetSize <= bufSize );
nRead = blocking_read( sock, buf, packetSize );
if ( nRead == packetSize ) {
if ( nRead != packetSize ) {
nRead = -1;
} else {
LaunchParams* params = cGlobals->params;
++params->nPacketsRcvd;
if ( params->dropNthRcvd == 0 ) {