fixed resume data compatibility with 0.13
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user