| 2604 | |
| 2605 | |
| 2606 | void CPartFile::StopPausedFile() |
| 2607 | { |
| 2608 | if (!IsStopped()) { |
| 2609 | // Once an hour, remove any sources for files which are no longer active downloads |
| 2610 | switch (GetStatus()) { |
| 2611 | case PS_PAUSED: |
| 2612 | case PS_INSUFFICIENT: |
| 2613 | case PS_ERROR: |
| 2614 | if (time(NULL) - m_iLastPausePurge > (60*60)) { |
| 2615 | m_iLastPausePurge = time(NULL); |
| 2616 | StopFile(); |
| 2617 | } |
| 2618 | kBpsDown = 0.0; |
| 2619 | } |
| 2620 | } |
| 2621 | // release file handle if unused for some time |
| 2622 | m_hpartfile.Release(); |
| 2623 | } |
| 2624 | |
| 2625 | |
| 2626 | void CPartFile::PauseFile(bool bInsufficient) |