mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
fix failure to connect using means (e.g. BT) that becomes available
partway through a game. Problem was that once a channel was working with one means we wouldn't fall back to default addressing for the means for which we didn't have a return address yet. (NOTE: Not yet fully tested...)
This commit is contained in:
parent
b000564278
commit
2e8c7695f3
1 changed files with 8 additions and 11 deletions
|
@ -1392,23 +1392,20 @@ sendMsg( CommsCtxt* comms, MsgQueueElem* elem )
|
|||
const CommsAddrRec* addrP;
|
||||
(void)channelToAddress( comms, channelNo, &addrP );
|
||||
|
||||
if ( NULL == addrP ) {
|
||||
XP_LOGF( TAGFMT() "no addr for channel so using comms'", TAGPRMS );
|
||||
if ( NULL == addrP || !addr_hasType( addrP, typ ) ) {
|
||||
XP_LOGF( TAGFMT() "no addr for channel or addr type %s"
|
||||
" so using comms'", ConnType2Str(typ), TAGPRMS );
|
||||
comms_getAddr( comms, &addr );
|
||||
} else {
|
||||
addr = *addrP;
|
||||
}
|
||||
XP_ASSERT( addr_hasType( &addr, typ ) );
|
||||
|
||||
XP_ASSERT( !!comms->procs.send );
|
||||
if ( addr_hasType( &addr, typ ) ) {
|
||||
XP_U32 gameid = gameID( comms );
|
||||
logAddr( comms, &addr, __func__ );
|
||||
nSent = (*comms->procs.send)( elem->msg, elem->len, &addr, typ,
|
||||
gameid, comms->procs.closure );
|
||||
} else {
|
||||
XP_LOGF( TAGFMT() "not sending b/c type %s missing from addr",
|
||||
TAGPRMS, ConnType2Str(typ) );
|
||||
}
|
||||
XP_U32 gameid = gameID( comms );
|
||||
logAddr( comms, &addr, __func__ );
|
||||
nSent = (*comms->procs.send)( elem->msg, elem->len, &addr, typ,
|
||||
gameid, comms->procs.closure );
|
||||
break;
|
||||
}
|
||||
} /* switch */
|
||||
|
|
Loading…
Reference in a new issue