mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 22:40:36 -04:00
Modified bitdht to enable simultaneous peer searches.
* Added maximum msg limits (20, 50, 100 msgs per sec). 50 = default. * Priority send out pings, with 10% queries. * switched bdquery list in bdnode to use pointers... so peers can be easily reordered (queue for queries). * Add all find peers, once dht initialised. * Added reset if FINDSELF fails. (don't know if this is a good idea!) * simplified DHT printouts. verbose versions are enabled with debug. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3686 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6fb89a90b2
commit
9cf531fc9a
6 changed files with 153 additions and 32 deletions
|
@ -184,7 +184,9 @@ void bdNodeManager::startQueries()
|
|||
|
||||
uint32_t qflags = it->second.mQFlags | BITDHT_QFLAGS_DISGUISE;
|
||||
addQuery(&(it->first), qflags);
|
||||
return;
|
||||
|
||||
// add all queries at the same time!
|
||||
//return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -251,16 +253,16 @@ void bdNodeManager::iteration()
|
|||
case BITDHT_MGR_STATE_FINDSELF:
|
||||
/* 60 seconds further startup .... then switch to ACTIVE */
|
||||
#define MAX_FINDSELF_TIME 60
|
||||
#define MIN_OP_SPACE_SIZE 100
|
||||
#define MIN_OP_SPACE_SIZE 50 /* 100 seemed hard! */
|
||||
|
||||
{
|
||||
uint32_t nodeSpaceSize = mNodeSpace.calcSpaceSize();
|
||||
|
||||
#ifdef DEBUG_MGR
|
||||
#endif
|
||||
std::cerr << "bdNodeManager::iteration() Finding Oneself: ";
|
||||
std::cerr << "NodeSpace Size:" << nodeSpaceSize;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (nodeSpaceSize > MIN_OP_SPACE_SIZE)
|
||||
{
|
||||
|
@ -338,9 +340,9 @@ void bdNodeManager::iteration()
|
|||
default:
|
||||
case BITDHT_MGR_STATE_FAILED:
|
||||
{
|
||||
#ifdef DEBUG_MGR
|
||||
std::cerr << "bdNodeManager::iteration(): FAILED ==> STARTUP";
|
||||
std::cerr << std::endl;
|
||||
#ifdef DEBUG_MGR
|
||||
#endif
|
||||
stopDht();
|
||||
startDht();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue