Browse Source

Update the cached state once recheck is started

We have to force update the cached state, otherwise someone will be able to get an incorrect one during the interval until the cached state is updated in a regular way.

PR #18579.
Closes #18559.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
9fb9ca47f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/base/bittorrent/torrentimpl.cpp

4
src/base/bittorrent/torrentimpl.cpp

@ -1472,6 +1472,10 @@ void TorrentImpl::forceRecheck()
if (!hasMetadata()) return; if (!hasMetadata()) return;
m_nativeHandle.force_recheck(); m_nativeHandle.force_recheck();
// We have to force update the cached state, otherwise someone will be able to get
// an incorrect one during the interval until the cached state is updated in a regular way.
m_nativeStatus.state = lt::torrent_status::checking_resume_data;
m_hasMissingFiles = false; m_hasMissingFiles = false;
m_unchecked = false; m_unchecked = false;
m_completedFiles.fill(false); m_completedFiles.fill(false);

Loading…
Cancel
Save