From f7739a5699fff65a4952bd2b8ab1e081e222d7e6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 4 Apr 2012 05:32:06 +0000 Subject: [PATCH] only finalize files while downloading (not while checking) --- src/torrent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 6a3767f7d..169f0aca9 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -3079,7 +3079,12 @@ namespace libtorrent { if (!m_torrent_file->files().at(file_index).pad_file) { - if (m_owning_storage.get()) + // don't finalize files if we discover that they exist + // in whole (i.e. while checking). In that case, just assume + // they were finalized when they completed. + // The main purpose of finalizing files is to clear the sparse + // flag on windows, which only needs to be done once + if (m_owning_storage.get() && m_state == torrent_status::downloading) m_storage->async_finalize_file(file_index); if (m_ses.m_alerts.should_post())