mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-13 03:22:34 -04:00
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:
parent
2bd3899c05
commit
48218e98cb
14 changed files with 351 additions and 99 deletions
|
@ -119,7 +119,32 @@ void ftController::addFileSource(const std::string& hash,const std::string& peer
|
|||
std::cerr << "... not added: hash not found." << std::endl ;
|
||||
#endif
|
||||
}
|
||||
void ftController::removeFileSource(const std::string& hash,const std::string& peer_id)
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
|
||||
std::map<std::string, ftFileControl>::iterator it;
|
||||
std::map<std::string, ftFileControl> currentDownloads = *(&mDownloads);
|
||||
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController: Adding source " << peer_id << " to current download hash=" << hash ;
|
||||
#endif
|
||||
for(it = currentDownloads.begin(); it != currentDownloads.end(); it++)
|
||||
if(it->first == hash)
|
||||
{
|
||||
it->second.mTransfer->removeFileSource(peer_id);
|
||||
|
||||
// setPeerState(it->second.mTransfer, peer_id, rate, mConnMgr->isOnline(peer_id));
|
||||
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "... added." << std::endl ;
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "... not added: hash not found." << std::endl ;
|
||||
#endif
|
||||
}
|
||||
void ftController::run()
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue