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:
drbob 2010-07-31 18:01:24 +00:00
parent 1069ed0c58
commit c1b624832f
6 changed files with 24 additions and 9 deletions

View file

@ -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;