| 2551 | |
| 2552 | |
| 2553 | bool CPartFile::HasPendingHashWork() const |
| 2554 | { |
| 2555 | if (m_iWrites > 0) { |
| 2556 | return false; |
| 2557 | } |
| 2558 | for (bool dirty : m_aChangedPart) { |
| 2559 | if (dirty) { |
| 2560 | return true; |
| 2561 | } |
| 2562 | } |
| 2563 | // Completion-pending: gaplist is closed and the file is in active |
| 2564 | // state but writes haven't all been harvested yet — keep firing |
| 2565 | // FlushBuffer at Process tick rate so the trailing CompleteFile |
| 2566 | // check runs once the worker thread drains. Without this, a slow |
| 2567 | // worker that completes the gap-closing write after the last |
| 2568 | // FlushBuffer would leave us waiting for BUFFER_TIME_LIMIT (60 s). |
| 2569 | if (m_gaplist.IsComplete() |
| 2570 | && (status == PS_EMPTY || status == PS_READY) |
| 2571 | && !m_BufferedData_list.empty()) { |
| 2572 | return true; |
| 2573 | } |
| 2574 | return false; |
| 2575 | } |
| 2576 | |
| 2577 | |
| 2578 | void CPartFile::StopFile(bool bCancel) |
no test coverage detected