Fixed up BITDHT versioning.

* Advertises client as DBxxxx where xxxx is provided by using app.
  * Added COMPILE switches to enable ANONYMOUS version or remove BD portion.
  * Fixed version code.
  * Added slow increase in retry timeout, to reduce DHT traffic over time.
      now RETRY PERIOD = query age / 2  
  * initialised bdToken bdVersion etc length.
  * new bdboot.txt 



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3615 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-10-05 21:57:22 +00:00
parent d31cef0f11
commit cc5fa5e5dc
9 changed files with 268 additions and 208 deletions

View file

@ -41,17 +41,31 @@
/*
* #define DEBUG_UDP_BITDHT 1
*
* #define BITDHT_VERSION_ANONYMOUS 1
*/
//#define DEBUG_UDP_BITDHT 1
#define BITDHT_VERSION_IDENTIFER 1
/*************************************/
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string dhtVersion, std::string bootstrapfile, bdDhtFunctions *fns)
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, bdDhtFunctions *fns)
:UdpSubReceiver(pub), mFns(fns)
{
std::string usedVersion;
#ifdef BITDHT_VERSION_IDENTIFER
usedVersion = "BD";
#endif
usedVersion += appVersion;
#ifdef BITDHT_VERSION_ANONYMOUS
usedVersion = ""; /* blank it */
#endif
/* setup nodeManager */
mBitDhtManager = new bdNodeManager(id, dhtVersion, bootstrapfile, fns);
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, fns);
}