MCPcopy Create free account
hub / github.com/amule-project/amule / IsDeadSource

Method IsDeadSource

src/DeadSourceList.cpp:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95bool 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
123void CDeadSourceList::AddDeadSource( const CUpDownClient* client )

Callers

nothing calls this directly

Calls 7

GetTickCount64Function · 0.85
eraseMethod · 0.80
GetUserIDHybridMethod · 0.45
GetUserPortMethod · 0.45
GetServerIPMethod · 0.45
GetKadPortMethod · 0.45
GetTimeoutMethod · 0.45

Tested by

no test coverage detected