- added random bias to search and tunnel request maximum depth

- added random (and biased) re-routing of tunnel request to improve tunnel length.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4130 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-04-07 20:16:43 +00:00
parent bcdf536c98
commit 8e6962808d
2 changed files with 47 additions and 5 deletions

View file

@ -164,6 +164,7 @@ class TurtleRequestInfo
public:
TurtlePeerId origin ; // where the request came from.
uint32_t time_stamp ; // last time the tunnel was actually used. Used for cleaning old tunnels.
int depth ; // depth of the request. Used to optimize tunnel length.
};
class TurtleTunnel
@ -402,6 +403,11 @@ class p3turtle: public p3Service, /*public pqiMonitor,*/ public RsTurtle,/* publ
/// used to force digging new tunnels
bool _force_digg_new_tunnels ;
/// used as a bias to introduce randomness in a consistent way, for
/// altering tunnel request depths, and tunnel re-routing actions.
///
uint32_t _random_bias ;
#ifdef P3TURTLE_DEBUG
// debug function
void dumpState() ;