fix one more web seed issue caused by introducing a peer_info struct for web seeds

This commit is contained in:
Arvid Norberg 2012-04-14 06:32:35 +00:00
parent 4a2648d936
commit b491a76159
1 changed files with 8 additions and 0 deletions

View File

@ -4317,7 +4317,14 @@ namespace libtorrent
web->removed = true;
return;
}
peer_connection * peer = web->peer_info.connection;
if (peer) {
TORRENT_ASSERT(peer->m_in_use == 1337);
peer->set_peer_info(0);
}
if (has_picker()) picker().clear_peer(&web->peer_info);
m_web_seeds.erase(web);
}
@ -7867,6 +7874,7 @@ namespace libtorrent
, (boost::bind(&policy::peer::connection, boost::bind(&web_seed_entry::peer_info, _1)) == p));
TORRENT_ASSERT(i != m_web_seeds.end());
if (i == m_web_seeds.end()) return;
p->set_peer_info(0);
if (has_picker()) picker().clear_peer(&i->peer_info);
m_web_seeds.erase(i);
}