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

Method GetFileByID

src/DownloadQueue.cpp:563–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561
562
563CPartFile* CDownloadQueue::GetFileByID(const CMD4Hash& filehash) const
564{
565 wxMutexLocker lock( m_mutex );
566
567 for ( FileQueue::size_type i = 0; i < m_filelist.size(); ++i ) {
568 if ( filehash == m_filelist[i]->GetFileHash()) {
569 return m_filelist[ i ];
570 }
571 }
572 // Check completed too so we can execute remote commands (like change cat) on them
573 for (FileList::const_iterator it = m_completedDownloads.begin(); it != m_completedDownloads.end(); ++it) {
574 if ( filehash == (*it)->GetFileHash()) {
575 return *it;
576 }
577 }
578
579 return NULL;
580}
581
582
583CPartFile* CDownloadQueue::GetFileByIndex(unsigned int index) const

Callers 15

AddReqBlockMethod · 0.45
SendHashsetPacketMethod · 0.45
SetUploadFileIDMethod · 0.45
OnPartFileHashResultMethod · 0.45
ProcessPacketMethod · 0.45
PruneDuplicatesMethod · 0.45
ProcessAICHAnswerMethod · 0.45
ProcessAICHRequestMethod · 0.45
ProcessAICHFileHashMethod · 0.45
ProcessPacketMethod · 0.45
ProcessExtPacketMethod · 0.45

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected