From 643be6c44ba78a0836551e44e80bd8a946784d52 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 22 Mar 2009 22:21:48 +0000 Subject: [PATCH] fixed issue where renamed files would sometimes not be saved in the resume data --- ChangeLog | 1 + src/storage.cpp | 10 ---------- src/torrent.cpp | 11 +++++++++++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e0f4dbc9..86d3b68f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,6 +48,7 @@ release 0.14.3 * added error handling for set_piece_hashes * fixed missing include in enum_if.cpp * fixed dual IP stack issue + * fixed issue where renamed files were sometimes not saved in resume data release 0.14.2 diff --git a/src/storage.cpp b/src/storage.cpp index aa1400fe0..3f9db94ab 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -739,16 +739,6 @@ namespace libtorrent fl.push_back(entry(p)); } - if (m_mapped_files) - { - entry::list_type& fl = rd["mapped_files"].list(); - for (file_storage::iterator i = m_mapped_files->begin() - , end(m_mapped_files->end()); i != end; ++i) - { - fl.push_back(i->path.string()); - } - } - return false; } diff --git a/src/torrent.cpp b/src/torrent.cpp index bf43b31ef..78c3bf95f 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -3299,6 +3299,17 @@ namespace libtorrent pieces[i] |= m_verified[i] ? 2 : 0; } + // write renamed files + if (&m_torrent_file->files() != &m_torrent_file->orig_files()) + { + entry::list_type& fl = ret["mapped_files"].list(); + for (torrent_info::file_iterator i = m_torrent_file->begin_files() + , end(m_torrent_file->end_files()); i != end; ++i) + { + fl.push_back(i->path.string()); + } + } + // write local peers entry::list_type& peer_list = ret["peers"].list();