turtle tunnel management

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1289 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-06-03 18:47:14 +00:00
parent 2bd3899c05
commit 48218e98cb
14 changed files with 351 additions and 99 deletions

View file

@ -151,6 +151,27 @@ bool ftTransferModule::addFileSource(std::string peerId)
return true;
}
bool ftTransferModule::removeFileSource(std::string peerId)
{
RsStackMutex stack(tfMtx); /******* STACK LOCKED ******/
std::map<std::string,peerInfo>::iterator mit;
mit = mFileSources.find(peerId);
if (mit != mFileSources.end())
{
/* add in new source */
mFileSources.erase(mit) ;
#ifdef FT_DEBUG
std::cerr << "ftTransferModule::addFileSource(): removing peer: " << peerId << " from sourceList" << std::cerr << std::endl;
#endif
}
#ifdef FT_DEBUG
else
std::cerr << "ftTransferModule::addFileSource(): Should remove peer: " << peerId << ", but it's not in the source list. " << std::cerr << std::endl;
#endif
return true;
}
bool ftTransferModule::setPeerState(std::string peerId,uint32_t state,uint32_t maxRate)
{