Browse Source

Handle all "fastresume rejected" cases consistently

PR #17064.
adaptive-webui-19844
Vladimir Golovnev 3 years ago committed by GitHub
parent
commit
8c0cd09823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/base/bittorrent/torrentimpl.cpp
  2. 1
      src/base/bittorrent/torrentimpl.h

20
src/base/bittorrent/torrentimpl.cpp

@ -1726,9 +1726,6 @@ void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p) @@ -1726,9 +1726,6 @@ void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p)
if (m_nativeStatus.need_save_resume)
m_session->handleTorrentNeedSaveResumeData(this);
if (m_fastresumeDataRejected && !m_hasMissingFiles)
m_fastresumeDataRejected = false;
if (!m_hasMissingFiles)
{
if ((progress() < 1.0) && (wantedSize() > 0))
@ -1895,19 +1892,10 @@ void TorrentImpl::handleSaveResumeDataFailedAlert(const lt::save_resume_data_fai @@ -1895,19 +1892,10 @@ void TorrentImpl::handleSaveResumeDataFailedAlert(const lt::save_resume_data_fai
void TorrentImpl::handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p)
{
m_fastresumeDataRejected = true;
if (p->error.value() == lt::errors::mismatching_file_size)
{
// Mismatching file size (files were probably moved)
m_hasMissingFiles = true;
LogMsg(tr("File sizes mismatch for torrent '%1'. Cannot proceed further.").arg(name()), Log::CRITICAL);
}
else
{
LogMsg(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
.arg(name(), QString::fromStdString(p->message())), Log::WARNING);
}
// Files were probably moved or storage isn't accessible
m_hasMissingFiles = true;
LogMsg(tr("Failed to restore torrent. Files were probably moved or storage isn't accessible. Torrent: \"%1\". Reason: \"%2\"")
.arg(name(), QString::fromStdString(p->message())), Log::WARNING);
}
void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)

1
src/base/bittorrent/torrentimpl.h

@ -324,7 +324,6 @@ namespace BitTorrent @@ -324,7 +324,6 @@ namespace BitTorrent
TorrentOperatingMode m_operatingMode;
TorrentContentLayout m_contentLayout;
bool m_hasSeedStatus;
bool m_fastresumeDataRejected = false;
bool m_hasMissingFiles = false;
bool m_hasFirstLastPiecePriority = false;
bool m_useAutoTMM;

Loading…
Cancel
Save