merged resume data fix from RC_1_0

This commit is contained in:
Arvid Norberg 2014-07-15 03:23:43 +00:00
parent b49f78d180
commit d2fccd8ae7
2 changed files with 18 additions and 20 deletions

View File

@ -89,6 +89,7 @@
* fix uTP edge case where udp socket buffer fills up * fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP * fix nagle implementation in uTP
* fix saving resume data when removing all trackers
* fix bug in udp_socket when changing socks5 proxy quickly * fix bug in udp_socket when changing socks5 proxy quickly
0.16.17 release 0.16.17 release

View File

@ -6760,28 +6760,25 @@ namespace libtorrent
} }
// save trackers // save trackers
if (!m_trackers.empty()) entry::list_type& tr_list = ret["trackers"].list();
tr_list.push_back(entry::list_type());
int tier = 0;
for (std::vector<announce_entry>::const_iterator i = m_trackers.begin()
, end(m_trackers.end()); i != end; ++i)
{ {
entry::list_type& tr_list = ret["trackers"].list(); // don't save trackers we can't trust
tr_list.push_back(entry::list_type()); // TODO: 1 save the send_stats state instead of throwing them away
int tier = 0; // it may pose an issue when downgrading though
for (std::vector<announce_entry>::const_iterator i = m_trackers.begin() if (i->send_stats == false) continue;
, end(m_trackers.end()); i != end; ++i) if (i->tier == tier)
{ {
// don't save trackers we can't trust tr_list.back().list().push_back(i->url);
// TODO: 1 save the send_stats state instead of throwing them away }
// it may pose an issue when downgrading though else
if (i->send_stats == false) continue; {
if (i->tier == tier) tr_list.push_back(entry::list_t);
{ tr_list.back().list().push_back(i->url);
tr_list.back().list().push_back(i->url); tier = i->tier;
}
else
{
tr_list.push_back(entry::list_t);
tr_list.back().list().push_back(i->url);
tier = i->tier;
}
} }
} }