mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 22:40:36 -04:00
updates to libbitdht to make it work with retroshare.
* decreased nodes per bucket to 10 - to try reduce traffic. * changed operator< to non const. * fixed up debuging. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3322 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1069ed0c58
commit
c1b624832f
6 changed files with 24 additions and 9 deletions
|
@ -54,7 +54,7 @@
|
|||
* #define DEBUG_MGR_PKT 1
|
||||
***/
|
||||
|
||||
//#define DEBUG_MGR 1
|
||||
#define DEBUG_MGR 1
|
||||
|
||||
bdNodeManager::bdNodeManager(bdNodeId *id, std::string dhtVersion, std::string bootfile, bdDhtFunctions *fns)
|
||||
:bdNode(id, dhtVersion, bootfile, fns)
|
||||
|
@ -141,7 +141,7 @@ void bdNodeManager::iteration()
|
|||
if (modeAge > MAX_STARTUP_TIME)
|
||||
{
|
||||
#ifdef DEBUG_MGR
|
||||
std::cerr << "bdNodeManager::iteration(): STARTUP ";
|
||||
std::cerr << "bdNodeManager::iteration(): STARTUP -> REFRESH";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
bdNodeId id;
|
||||
|
@ -157,6 +157,10 @@ void bdNodeManager::iteration()
|
|||
case BITDHT_MGR_STATE_ACTIVE:
|
||||
if (modeAge > MAX_REFRESH_TIME)
|
||||
{
|
||||
#ifdef DEBUG_MGR
|
||||
std::cerr << "bdNodeManager::iteration(): ACTIVE -> REFRESH";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
mMode = BITDHT_MGR_STATE_REFRESH;
|
||||
mModeTS = now;
|
||||
}
|
||||
|
@ -165,6 +169,10 @@ void bdNodeManager::iteration()
|
|||
|
||||
case BITDHT_MGR_STATE_REFRESH:
|
||||
{
|
||||
#ifdef DEBUG_MGR
|
||||
std::cerr << "bdNodeManager::iteration(): REFRESH -> ACTIVE";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
/* select random ids, and perform searchs to refresh space */
|
||||
mMode = BITDHT_MGR_STATE_ACTIVE;
|
||||
mModeTS = now;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue