filters trackers with empty url fields

This commit is contained in:
Arvid Norberg 2009-04-26 08:05:42 +00:00
parent 86a3bf3e07
commit 3ecbcc8fe7
1 changed files with 4 additions and 1 deletions

View File

@ -2452,7 +2452,10 @@ namespace libtorrent
void torrent::replace_trackers(std::vector<announce_entry> const& urls)
{
m_trackers = urls;
m_trackers.clear();
std::remove_copy_if(urls.begin(), urls.end(), back_inserter(m_trackers)
, boost::bind(&std::string::empty, boost::bind(&announce_entry::url, _1)));
m_last_working_tracker = -1;
for (std::vector<announce_entry>::iterator i = m_trackers.begin()
, end(m_trackers.end()); i != end; ++i)