diff --git a/ChangeLog b/ChangeLog index 9aa046a68..36df4ed12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -71,6 +71,7 @@ release 0.14.5 * allow 0 upload slots * fixed bug in rename_file(). The new name would not always be saved in the resume data + * fixed resume data compatibility with 0.13 release 0.14.4 diff --git a/src/torrent.cpp b/src/torrent.cpp index 958ef4b73..8437095b5 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -836,6 +836,18 @@ namespace libtorrent if (m_seed_mode && (pieces_str[i] & 2)) m_verified.set_bit(i); } } + else + { + lazy_entry const* slots = m_resume_entry.dict_find("slots"); + if (slots && slots->type() == lazy_entry::list_t) + { + for (int i = 0; i < slots->list_size(); ++i) + { + int piece = slots->list_int_value_at(i, -1); + if (piece >= 0) m_picker->we_have(piece); + } + } + } // parse unfinished pieces int num_blocks_per_piece = @@ -3312,6 +3324,7 @@ namespace libtorrent using namespace libtorrent::detail; // for write_*_endpoint() ret["file-format"] = "libtorrent resume file"; ret["file-version"] = 1; + ret["libtorrent-version"] = LIBTORRENT_VERSION; ret["total_uploaded"] = m_total_uploaded; ret["total_downloaded"] = m_total_downloaded;