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

Method AddTrackClient

src/ClientList.cpp:483–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481
482
483void CClientList::AddTrackClient(CUpDownClient* toadd)
484{
485 std::map<uint32, CDeletedClient*>::iterator it = m_trackedClientsList.find( toadd->GetIP() );
486
487 if ( it != m_trackedClientsList.end() ) {
488 CDeletedClient* pResult = it->second;
489
490 pResult->m_dwInserted = ::GetTickCount64();
491
492 CDeletedClient::PaHList::iterator it2 = pResult->m_ItemsList.begin();
493 for ( ; it2 != pResult->m_ItemsList.end(); ++it2 ) {
494 if ( it2->nPort == toadd->GetUserPort() ) {
495 // already tracked, update
496 it2->pHash = toadd->GetCreditsHash();
497 return;
498 }
499 }
500
501 // New client for that IP, add an entry
502 CDeletedClient::PortAndHash porthash = { toadd->GetUserPort(), toadd->GetCreditsHash()};
503 pResult->m_ItemsList.push_back(porthash);
504 } else {
505 m_trackedClientsList[ toadd->GetIP() ] = new CDeletedClient(toadd);
506 }
507}
508
509
510uint16 CClientList::GetClientsFromIP(uint32 dwIP)

Callers 6

UnBanMethod · 0.80
BanMethod · 0.80
EvaluateDataMethod · 0.80
AddClientToQueueMethod · 0.80
RemoveFromUploadQueueMethod · 0.80

Calls 6

GetTickCount64Function · 0.85
GetCreditsHashMethod · 0.80
GetIPMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
GetUserPortMethod · 0.45

Tested by

no test coverage detected