| 1550 | |
| 1551 | |
| 1552 | void 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 | |
| 1574 | void CamuleApp::OnFinishedAICHHashing(CHashingEvent& evt) |
nothing calls this directly
no test coverage detected