mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
transfers - add peer names for turtle routed sources
This commit is contained in:
parent
cf2edb50b4
commit
6a2181ca14
4 changed files with 28 additions and 2 deletions
|
@ -2001,6 +2001,25 @@ void p3turtle::getTrafficStatistics(TurtleTrafficStatisticsInfo& info) const
|
|||
}
|
||||
}
|
||||
|
||||
std::string p3turtle::getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_id)
|
||||
{
|
||||
std::string name = "unknown";
|
||||
std::map<TurtleVirtualPeerId,TurtleTunnelId>::const_iterator it(_virtual_peers.find(virtual_peer_id)) ;
|
||||
if(it != _virtual_peers.end())
|
||||
{
|
||||
TurtleTunnelId tunnel_id = it->second ;
|
||||
std::map<TurtleTunnelId,TurtleTunnel>::iterator it2( _local_tunnels.find(tunnel_id) ) ;
|
||||
if(it2 != _local_tunnels.end())
|
||||
{
|
||||
if(it2->second.local_src == _own_id)
|
||||
mLinkMgr->getPeerName(it2->second.local_dst,name);
|
||||
else
|
||||
mLinkMgr->getPeerName(it2->second.local_src,name);
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
void p3turtle::getInfo( std::vector<std::vector<std::string> >& hashes_info,
|
||||
std::vector<std::vector<std::string> >& tunnels_info,
|
||||
std::vector<TurtleRequestDisplayInfo >& search_reqs_info,
|
||||
|
|
|
@ -275,6 +275,8 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config
|
|||
///
|
||||
virtual void registerTunnelService(RsTurtleClientService *service) ;
|
||||
|
||||
virtual std::string getPeerNameForVirtualPeerId(const RsPeerId& virtual_peer_id);
|
||||
|
||||
/// get info about tunnels
|
||||
virtual void getInfo(std::vector<std::vector<std::string> >&,
|
||||
std::vector<std::vector<std::string> >&,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue