mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
remove bad asserts and unused variable
This commit is contained in:
parent
cc69901632
commit
82dc986c79
1 changed files with 7 additions and 7 deletions
|
@ -211,6 +211,9 @@ parseRelayID( const unsigned char** const inp, const unsigned char* const end,
|
||||||
}
|
}
|
||||||
*inp = (unsigned char*)endptr;
|
*inp = (unsigned char*)endptr;
|
||||||
}
|
}
|
||||||
|
if ( !ok ) {
|
||||||
|
logf( XW_LOGERROR, "%s failed", __func__ );
|
||||||
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,7 +1033,6 @@ handlePutMessage( SafeCref& scr, HostID hid, const AddrInfo* addr,
|
||||||
unsigned short len, const unsigned char** bufp,
|
unsigned short len, const unsigned char** bufp,
|
||||||
const unsigned char* end )
|
const unsigned char* end )
|
||||||
{
|
{
|
||||||
logf( XW_LOGINFO, "%s()", __func__ );
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
const unsigned char* start = *bufp;
|
const unsigned char* start = *bufp;
|
||||||
HostID src;
|
HostID src;
|
||||||
|
@ -1039,9 +1041,9 @@ handlePutMessage( SafeCref& scr, HostID hid, const AddrInfo* addr,
|
||||||
// sanity check that cmd and hostids are there
|
// sanity check that cmd and hostids are there
|
||||||
if ( getNetByte( bufp, end, &cmd )
|
if ( getNetByte( bufp, end, &cmd )
|
||||||
&& getNetByte( bufp, end, &src )
|
&& getNetByte( bufp, end, &src )
|
||||||
&& getNetByte( bufp, end, &dest ) ) {
|
&& getNetByte( bufp, end, &dest )
|
||||||
assert( cmd == XWRELAY_MSG_TORELAY_NOCONN );
|
&& ( cmd == XWRELAY_MSG_TORELAY_NOCONN )
|
||||||
assert( hid == dest );
|
&& ( hid == dest ) ) {
|
||||||
scr.PutMsg( src, addr, dest, start, len );
|
scr.PutMsg( src, addr, dest, start, len );
|
||||||
*bufp = start + len;
|
*bufp = start + len;
|
||||||
success = true;
|
success = true;
|
||||||
|
@ -1058,8 +1060,6 @@ handleProxyMsgs( int sock, const AddrInfo* addr, const unsigned char* bufp,
|
||||||
unsigned short nameCount;
|
unsigned short nameCount;
|
||||||
int ii;
|
int ii;
|
||||||
if ( getNetShort( &bufp, end, &nameCount ) ) {
|
if ( getNetShort( &bufp, end, &nameCount ) ) {
|
||||||
vector<unsigned char> out(4); /* space for len and n_msgs */
|
|
||||||
assert( out.size() == 4 );
|
|
||||||
for ( ii = 0; ii < nameCount && bufp < end; ++ii ) {
|
for ( ii = 0; ii < nameCount && bufp < end; ++ii ) {
|
||||||
|
|
||||||
// See NetUtils.java for reply format
|
// See NetUtils.java for reply format
|
||||||
|
@ -1092,7 +1092,7 @@ handleProxyMsgs( int sock, const AddrInfo* addr, const unsigned char* bufp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( bufp != end ) {
|
if ( end - bufp != 1 ) {
|
||||||
logf( XW_LOGERROR, "%s: buf != end: %p vs %p", __func__, bufp, end );
|
logf( XW_LOGERROR, "%s: buf != end: %p vs %p", __func__, bufp, end );
|
||||||
}
|
}
|
||||||
// assert( bufp == end ); // don't ship with this!!!
|
// assert( bufp == end ); // don't ship with this!!!
|
||||||
|
|
Loading…
Reference in a new issue