mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Merge pull request #8711 from sledgehammer999/recheck_paused
Avoid data corruption when rechecking paused torrents
This commit is contained in:
commit
341a971cd3
2 changed files with 8 additions and 2 deletions
|
@ -1277,7 +1277,7 @@ void TorrentHandle::forceRecheck()
|
||||||
|
|
||||||
if (isPaused()) {
|
if (isPaused()) {
|
||||||
m_pauseAfterRecheck = true;
|
m_pauseAfterRecheck = true;
|
||||||
resume();
|
resume_impl(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_nativeHandle.force_recheck();
|
m_nativeHandle.force_recheck();
|
||||||
|
@ -1345,12 +1345,17 @@ void TorrentHandle::pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandle::resume(bool forced)
|
void TorrentHandle::resume(bool forced)
|
||||||
|
{
|
||||||
|
resume_impl(forced, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TorrentHandle::resume_impl(bool forced, bool uploadMode)
|
||||||
{
|
{
|
||||||
if (hasError())
|
if (hasError())
|
||||||
m_nativeHandle.clear_error();
|
m_nativeHandle.clear_error();
|
||||||
m_hasMissingFiles = false;
|
m_hasMissingFiles = false;
|
||||||
m_nativeHandle.set_upload_mode(false);
|
|
||||||
m_nativeHandle.auto_managed(!forced);
|
m_nativeHandle.auto_managed(!forced);
|
||||||
|
m_nativeHandle.set_upload_mode(uploadMode);
|
||||||
m_nativeHandle.resume();
|
m_nativeHandle.resume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -406,6 +406,7 @@ namespace BitTorrent
|
||||||
void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p);
|
void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p);
|
||||||
void handleStatsAlert(libtorrent::stats_alert *p);
|
void handleStatsAlert(libtorrent::stats_alert *p);
|
||||||
|
|
||||||
|
void resume_impl(bool forced, bool uploadMode);
|
||||||
bool isMoveInProgress() const;
|
bool isMoveInProgress() const;
|
||||||
QString nativeActualSavePath() const;
|
QString nativeActualSavePath() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue