increased responsivness of distant chat by forcing tunnel re-digging when no activity is detected. WARNING: the new timestamps make the communication break will peers not up to date, since they will not send keep alive packets on the same delay basis.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8023 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-03-15 13:23:03 +00:00
parent 553240cda9
commit 67c5ef9c8a
3 changed files with 38 additions and 73 deletions

View file

@ -359,7 +359,7 @@ void p3turtle::manageTunnels()
// digg new tunnels if no tunnels are available and force digg new tunnels at regular (large) interval
//
for(std::map<TurtleFileHash,TurtleHashInfo>::const_iterator it(_incoming_file_hashes.begin());it!=_incoming_file_hashes.end();++it)
{
{
// get total tunnel speed.
//
uint32_t total_speed = 0 ;
@ -541,6 +541,21 @@ void p3turtle::autoWash()
}
}
void p3turtle::forceReDiggTunnels(const TurtleFileHash& hash)
{
{
RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/
if( _incoming_file_hashes.find(hash) == _incoming_file_hashes.end())
{
std::cerr << "(EE) p3turtle::forceReDiggTunnels(): hash " << hash << " is not currently handled by turtle." << std::endl;
return ;
}
}
diggTunnel(hash) ;
}
void p3turtle::locked_closeTunnel(TurtleTunnelId tid,std::vector<std::pair<RsTurtleClientService*,std::pair<TurtleFileHash,TurtleVirtualPeerId> > >& sources_to_remove)
{
// This is closing a given tunnel, removing it from file sources, and from the list of tunnels of its

View file

@ -259,7 +259,13 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config
///
virtual void stopMonitoringTunnels(const RsFileHash& file_hash) ;
/// Adds a client tunnel service. This means that the service will be added
/// This is provided to turtle clients to force the TR to ask tunnels again. To be used wisely:
/// too many tunnel requests will kill the network. This might be useful to speed-up the re-establishment
/// of tunnels that have become irresponsive.
virtual void forceReDiggTunnels(const TurtleFileHash& hash) ;
/// Adds a client tunnel service. This means that the service will be added
/// to the list of services that might respond to tunnel requests.
/// Example tunnel services include:
///