added control over TR forward rate, so that we can experiment with it on large bandwidth servers

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4918 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-02-10 22:23:06 +00:00
parent f6c88667c4
commit fd83e5950f
6 changed files with 143 additions and 43 deletions

View file

@ -250,14 +250,6 @@ class p3turtle: public p3Service, /*public pqiMonitor,*/ public RsTurtle,/* publ
virtual void getTrafficStatistics(TurtleTrafficStatisticsInfo& info) const ;
#ifdef TO_REMOVE
/************* from pqiMonitor *******************/
/// Informs the turtle router that some peers are (dis)connected. This should initiate digging new tunnels,
/// and closing other tunnels.
///
virtual void statusChange(const std::list<pqipeer> &plist);
#endif
/************* from pqiMonitor *******************/
/// This function does many things:
@ -271,13 +263,17 @@ class p3turtle: public p3Service, /*public pqiMonitor,*/ public RsTurtle,/* publ
/************* from p3Config *******************/
virtual RsSerialiser *setupSerialiser() ;
virtual bool saveList(bool& cleanup, std::list<RsItem*>&) ;
virtual bool loadList(std::list<RsItem*>& /*load*/) { return true; }
virtual bool loadList(std::list<RsItem*>& /*load*/) ;
/************* Communication with ftserver *******************/
/// Does the turtle router manages tunnels to this peer ? (this is not a
/// real id, but a fake one, that the turtle router is capable of connecting with a tunnel id).
virtual bool isTurtlePeer(const std::string& peer_id) const ;
/// sets/gets the max number of forwarded tunnel requests per second.
virtual void setMaxTRForwardRate(int max_tr_up_rate) ;
virtual int getMaxTRForwardRate() const ;
/// Examines the peer id, finds the turtle tunnel in it, and respond yes if the tunnel is ok and operational.
bool isOnline(const std::string& peer_id) const ;
@ -418,6 +414,8 @@ class p3turtle: public p3Service, /*public pqiMonitor,*/ public RsTurtle,/* publ
TurtleTrafficStatisticsInfoOp _traffic_info ; // used for recording speed
TurtleTrafficStatisticsInfoOp _traffic_info_buffer ; // used as a buffer to collect bytes
float _max_tr_up_rate ;
#ifdef P3TURTLE_DEBUG
// debug function
void dumpState() ;