From 77cc2b4eea9621c5540419a7a56254fb180c79b9 Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 13 Jun 2017 20:33:46 -0400 Subject: [PATCH] fix re-check issue after move_storage --- ChangeLog | 1 + src/storage.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index abe66b596..c2c9a7b7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * fix re-check issue after move_storage * handle invalid arguments to set_piece_deadline() * move_storage did not work for torrents without metadata * improve shutdown time by only announcing to trackers whose IP we know diff --git a/src/storage.cpp b/src/storage.cpp index 9c0b7b1ce..afb67c8f8 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1239,6 +1239,8 @@ namespace libtorrent if (flags == dont_replace && exists(new_path)) { if (ret == piece_manager::no_error) ret = piece_manager::need_full_check; + // this is a new file, clear our cached version + m_stat_cache.set_dirty(i); continue; } @@ -1250,7 +1252,12 @@ namespace libtorrent // if the source file doesn't exist. That's not a problem // we just ignore that file if (e == boost::system::errc::no_such_file_or_directory) + { e.clear(); + // the source file doesn't exist, but it may exist at the + // destination, we don't know. + m_stat_cache.set_dirty(i); + } else if (e && e != boost::system::errc::invalid_argument && e != boost::system::errc::permission_denied)