mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
test that address is good each time through loop
This commit is contained in:
parent
23c66e93ab
commit
2cd84c4229
1 changed files with 12 additions and 14 deletions
|
@ -857,21 +857,19 @@ void
|
||||||
CookieRef::send_stored_messages( HostID dest, const AddrInfo* addr )
|
CookieRef::send_stored_messages( HostID dest, const AddrInfo* addr )
|
||||||
{
|
{
|
||||||
logf( XW_LOGVERBOSE0, "%s(dest=%d)", __func__, dest );
|
logf( XW_LOGVERBOSE0, "%s(dest=%d)", __func__, dest );
|
||||||
|
|
||||||
assert( dest > 0 && dest <= 4 );
|
assert( dest > 0 && dest <= 4 );
|
||||||
if ( addr->isCurrent() ) {
|
|
||||||
DBMgr* dbmgr = DBMgr::Get();
|
DBMgr* dbmgr = DBMgr::Get();
|
||||||
const char* cname = ConnName();
|
const char* cname = ConnName();
|
||||||
for ( ; ; ) {
|
while ( addr->isCurrent() ) {
|
||||||
unsigned char buf[MAX_MSG_LEN];
|
unsigned char buf[MAX_MSG_LEN];
|
||||||
size_t buflen = sizeof(buf);
|
size_t buflen = sizeof(buf);
|
||||||
int msgID;
|
int msgID;
|
||||||
if ( !dbmgr->GetStoredMessage( cname, dest, buf, &buflen, &msgID )
|
if ( !dbmgr->GetStoredMessage( cname, dest, buf, &buflen, &msgID )
|
||||||
|| ! send_with_length( addr, dest, buf, buflen, true ) ) {
|
|| ! send_with_length( addr, dest, buf, buflen, true ) ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dbmgr->RemoveStoredMessages( &msgID, 1 );
|
dbmgr->RemoveStoredMessages( &msgID, 1 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} /* send_stored_messages */
|
} /* send_stored_messages */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue