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

Method OnPartFileHashResult

src/amule.cpp:1552–1571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1550
1551
1552void CamuleApp::OnPartFileHashResult(CPartFileHashResultEvent& evt)
1553{
1554 if (m_app_state == APP_STATE_SHUTTINGDOWN || !theApp || !theApp->IsRunning()) {
1555 return;
1556 }
1557
1558 // Look up the file by hash. If it was removed from the download
1559 // queue between enqueue and dispatch (cancelled, completed early)
1560 // the lookup returns NULL and we drop the event safely.
1561 CPartFile* file = downloadqueue->GetFileByID(evt.FileHash());
1562 if (!file) {
1563 AddDebugLogLineN(logPartFile, CFormat(
1564 "Hash result for part %u: file no longer in download queue, dropping")
1565 % evt.PartNumber());
1566 return;
1567 }
1568
1569 file->OnAsyncHashComplete(evt.PartNumber(), evt.Ok(),
1570 evt.FromAICHRecoveryDataAvailable());
1571}
1572
1573
1574void CamuleApp::OnFinishedAICHHashing(CHashingEvent& evt)

Callers

nothing calls this directly

Calls 8

CFormatClass · 0.85
PartNumberMethod · 0.80
OnAsyncHashCompleteMethod · 0.80
IsRunningMethod · 0.45
GetFileByIDMethod · 0.45
FileHashMethod · 0.45
OkMethod · 0.45

Tested by

no test coverage detected