oops: still remove address from set tracked if it's not tcp

This commit is contained in:
Eric House 2013-08-05 07:50:11 -07:00
parent 4ad6696ecc
commit 470dbb5304
2 changed files with 22 additions and 21 deletions

View file

@ -419,14 +419,14 @@ CookieRef::removeSocket( const AddrInfo* addr )
{
RWWriteLock rwl( &m_socketsRWLock );
vector<HostRec>::iterator iter;
for ( iter = m_sockets.begin(); !found && iter != m_sockets.end(); ++iter ) {
for ( iter = m_sockets.begin(); !found && iter != m_sockets.end();
++iter ) {
if ( iter->m_addr.equals( *addr ) ) {
if ( iter->m_ackPending ) {
logf( XW_LOGINFO,
"%s: Never got ack; removing hid %d from DB",
__func__, iter->m_hostID );
DBMgr::Get()->RmDeviceByHid( ConnName(),
iter->m_hostID );
DBMgr::Get()->RmDeviceByHid( ConnName(), iter->m_hostID );
m_nPlayersHere -= iter->m_nPlayersH;
cancelAckTimer( iter->m_hostID );
}
@ -831,7 +831,7 @@ CookieRef::send_with_length( const AddrInfo* addr, HostID dest,
failed = true;
}
if ( failed && cascade && addr->isTCP() ) {
if ( failed && cascade ) {
pushRemoveSocketEvent( addr );
XWThreadPool::GetTPool()->CloseSocket( addr );
}

View file

@ -173,7 +173,7 @@ XWThreadPool::RemoveSocket( const AddrInfo* addr )
void
XWThreadPool::CloseSocket( const AddrInfo* addr )
{
assert( addr->isTCP() );
if ( addr->isTCP() ) {
if ( !RemoveSocket( addr ) ) {
MutexLock ml( &m_queueMutex );
deque<QueuePr>::iterator iter = m_queue.begin();
@ -194,6 +194,7 @@ XWThreadPool::CloseSocket( const AddrInfo* addr )
blocking.*/
interrupt_poll();
}
}
void
XWThreadPool::EnqueueKill( const AddrInfo* addr, const char* const why )