| 93 | |
| 94 | |
| 95 | bool CDeadSourceList::IsDeadSource(const CUpDownClient* client) |
| 96 | { |
| 97 | CDeadSource source( |
| 98 | client->GetUserIDHybrid(), |
| 99 | client->GetUserPort(), |
| 100 | client->GetServerIP(), |
| 101 | client->GetKadPort() |
| 102 | ); |
| 103 | |
| 104 | |
| 105 | DeadSourcePair range = m_sources.equal_range( client->GetUserIDHybrid() ); |
| 106 | for ( ; range.first != range.second; range.first++ ) { |
| 107 | if ( range.first->second == source ) { |
| 108 | // Check if the entry is still valid |
| 109 | if ( range.first->second.GetTimeout() > GetTickCount64() ) { |
| 110 | return true; |
| 111 | } |
| 112 | |
| 113 | // The source is no longer dead, so remove it to reduce the size of the list |
| 114 | m_sources.erase( range.first ); |
| 115 | break; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | return false; |
| 120 | } |
| 121 | |
| 122 | |
| 123 | void CDeadSourceList::AddDeadSource( const CUpDownClient* client ) |
nothing calls this directly
no test coverage detected