mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
fix crash when linux is bt server: if no addr provided it's not a duplicate.
This commit is contained in:
parent
e90db9776f
commit
924fa5c12b
1 changed files with 21 additions and 22 deletions
|
@ -841,29 +841,28 @@ static XP_Bool
|
||||||
addressUnknown( CommsCtxt* comms, const CommsAddrRec* addr )
|
addressUnknown( CommsCtxt* comms, const CommsAddrRec* addr )
|
||||||
{
|
{
|
||||||
XP_Bool unknown = XP_TRUE;
|
XP_Bool unknown = XP_TRUE;
|
||||||
AddressRecord* rec;
|
if ( !!addr ) {
|
||||||
CommsConnType conType = addr->conType;
|
CommsConnType conType = addr->conType;
|
||||||
|
const AddressRecord* rec;
|
||||||
XP_ASSERT( !!addr || comms->addr.conType == COMMS_CONN_IR );
|
for ( rec = comms->recs; !!rec && unknown ; rec = rec->next ) {
|
||||||
|
XP_ASSERT( conType == rec->addr.conType );
|
||||||
for ( rec = comms->recs; !!rec && unknown ; rec = rec->next ) {
|
switch( conType ) {
|
||||||
XP_ASSERT( conType == rec->addr.conType );
|
case COMMS_CONN_RELAY:
|
||||||
switch( conType ) {
|
if ( (addr->u.ip_relay.ipAddr == rec->addr.u.ip_relay.ipAddr)
|
||||||
case COMMS_CONN_RELAY:
|
&& (addr->u.ip_relay.port == rec->addr.u.ip_relay.port ) ) {
|
||||||
if ( (addr->u.ip_relay.ipAddr == rec->addr.u.ip_relay.ipAddr)
|
unknown = XP_FALSE;
|
||||||
&& (addr->u.ip_relay.port == rec->addr.u.ip_relay.port ) ) {
|
}
|
||||||
unknown = XP_FALSE;
|
break;
|
||||||
|
case COMMS_CONN_BT:
|
||||||
|
if ( 0 == XP_MEMCMP( &addr->u.bt.btAddr, &rec->addr.u.bt.btAddr,
|
||||||
|
sizeof(addr->u.bt.btAddr) ) ) {
|
||||||
|
unknown = XP_FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case COMMS_CONN_IR: /* no way to test */
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case COMMS_CONN_BT:
|
|
||||||
if ( 0 == XP_MEMCMP( &addr->u.bt.btAddr, &rec->addr.u.bt.btAddr,
|
|
||||||
sizeof(addr->u.bt.btAddr) ) ) {
|
|
||||||
unknown = XP_FALSE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case COMMS_CONN_IR: /* no way to test */
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue