fixed resume data compatibility with 0.13

This commit is contained in:
Arvid Norberg 2009-06-27 21:47:30 +00:00
parent 32d1bdcf01
commit 44ace0b86b
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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;