2008-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Erase peer before executing onReturningPeer and onErasingPeer
	because choking algorithm called from onReturningPeer doesn't
	like erasing peer in the active peer list.
	* src/DefaultPeerStorage.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-11-15 13:39:29 +00:00
parent 7bcf0f48b2
commit c1a3bba6f8
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2008-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Erase peer before executing onReturningPeer and onErasingPeer
because choking algorithm called from onReturningPeer doesn't
like erasing peer in the active peer list.
* src/DefaultPeerStorage.cc
2008-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2008-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Instead of creating special filename in createDownloadResult() if Instead of creating special filename in createDownloadResult() if

View File

@ -247,10 +247,10 @@ void DefaultPeerStorage::returnPeer(const PeerHandle& peer)
if(itr == peers.end()) { if(itr == peers.end()) {
logger->debug("Cannot find peer %s:%u in PeerStorage.", peer->ipaddr.c_str(), peer->port); logger->debug("Cannot find peer %s:%u in PeerStorage.", peer->ipaddr.c_str(), peer->port);
} else { } else {
onReturningPeer(peer);
onErasingPeer(*itr);
peers.erase(itr); peers.erase(itr);
onReturningPeer(peer);
onErasingPeer(peer);
} }
} }