2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Request peers thought DHT only when download hasn't finished.
	* src/DHTGetPeersCommand.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-02-08 16:17:07 +00:00
parent 6fe7b7c8f3
commit f1d786469c
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Request peers thought DHT only when download hasn't finished.
* src/DHTGetPeersCommand.cc
2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Force refresh bucket when startup if certain time has passed(currently 15 minutes).

View File

@ -44,6 +44,7 @@
#include "BtContext.h"
#include "BtRuntime.h"
#include "PeerStorage.h"
#include "PieceStorage.h"
#include "Peer.h"
#include "Logger.h"
@ -71,7 +72,7 @@ bool DHTGetPeersCommand::execute()
if(btRuntime->isHalt()) {
return true;
}
if(_task.isNull() &&
if(!pieceStorage->downloadFinished() && _task.isNull() &&
(_numRetry > 0 && _lastGetPeerTime.elapsed(RETRY_INTERVAL) ||
_lastGetPeerTime.elapsed(GET_PEER_INTERVAL))) {
logger->debug("Issuing PeerLookup for infoHash=%s",