- modified ftFileProvider so as to keep multiple client peers per instance

- updated TransfersDialog to display this info correctly


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3316 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-07-27 16:05:21 +00:00
parent 8b3af9143f
commit 81203b3cfd
9 changed files with 220 additions and 245 deletions

View file

@ -684,10 +684,8 @@ bool ftDataMultiplex::locked_handleServerRequest(ftFileProvider *provider,
std::cerr << std::endl;
#endif
if (provider->getFileData(offset, chunksize, data))
if (provider->getFileData(peerId,offset, chunksize, data))
{
// setup info
provider->setPeerId(peerId) ;
/* send data out */
sendData(peerId, hash, size, offset, chunksize, data);
return true;
@ -738,26 +736,26 @@ void ftDataMultiplex::deleteUnusedServers()
//scan the uploads list in ftdatamultiplex and delete the items which time out
time_t now = time(NULL);
for(std::map<std::string, ftFileProvider *>::iterator sit(mServers.begin());sit != mServers.end();)
if ((now - sit->second->lastTS) > 10)
{
if(sit->second->purgeOldPeers(now,10))
{
#ifdef SERVER_DEBUG
std::cout << "info.lastTS = " << info.lastTS << ", now=" << now << std::endl ;
std::cout << "info.lastTS = " << info.lastTS << ", now=" << now << std::endl ;
#endif
// We don't delete servers that are clients at the same time !
if(dynamic_cast<ftFileCreator*>(sit->second) == NULL)
delete sit->second;
// We don't delete servers that are clients at the same time !
if(dynamic_cast<ftFileCreator*>(sit->second) == NULL)
delete sit->second;
std::map<std::string, ftFileProvider *>::iterator tmp(sit);
++tmp ;
std::map<std::string, ftFileProvider *>::iterator tmp(sit);
++tmp ;
mServers.erase(sit);
mServers.erase(sit);
sit = tmp ;
}
else
++sit ;
sit = tmp ;
}
else
++sit ;
}
bool ftDataMultiplex::handleSearchRequest(const std::string& peerId, const std::string& hash)