2010-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Few adjustment for timeouts in DHT. DHT message timeout is changed
	from 15 to 10. The interval of PeerLookup is first 5 seconds and
	it adds another 5 seconds in each retry.
	* src/DHTConstants.h
	* src/DHTGetPeersCommand.cc
	* src/DHTGetPeersCommand.h
pull/1/head
Tatsuhiro Tsujikawa 2010-03-12 15:05:53 +00:00
parent 7d8044ef10
commit 4e637779a5
4 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2010-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Few adjustment for timeouts in DHT. DHT message timeout is changed
from 15 to 10. The interval of PeerLookup is first 5 seconds and
it adds another 5 seconds in each retry.
* src/DHTConstants.h
* src/DHTGetPeersCommand.cc
* src/DHTGetPeersCommand.h
2010-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Changed log level from error to info for DHT message send error.

View File

@ -41,7 +41,7 @@
#define DHT_TOKEN_LENGTH 4
#define DHT_MESSAGE_TIMEOUT 15
#define DHT_MESSAGE_TIMEOUT 10
#define DHT_NODE_CONTACT_INTERVAL (15*60)

View File

@ -74,7 +74,7 @@ bool DHTGetPeersCommand::execute()
}
if(_task.isNull() &&
((_numRetry > 0 &&
_lastGetPeerTime.difference(global::wallclock) >= RETRY_INTERVAL) ||
_lastGetPeerTime.difference(global::wallclock) >= (time_t)_numRetry*5) ||
_lastGetPeerTime.difference(global::wallclock) >= GET_PEER_INTERVAL)) {
if(logger->debug()) {
logger->debug("Issuing PeerLookup for infoHash=%s",

View File

@ -54,8 +54,6 @@ class DHTGetPeersCommand:public Command {
private:
static const time_t GET_PEER_INTERVAL = (15*60);
static const time_t RETRY_INTERVAL = 60;
static const size_t MAX_RETRIES = 10;
RequestGroup* _requestGroup;