mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
two improvements of turtle router logic: increase of TR cache storage time to avoid too many void tunnels due to bouncing TR beyond storage period of 120 secs; prevent openning upload tunnels for files currently being downloaded before any chunk was obtained. Suggested by Jo.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7719 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3d6b5371f7
commit
21fe2413cd
2 changed files with 23 additions and 9 deletions
|
@ -486,9 +486,23 @@ void ftServer::removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualP
|
|||
|
||||
bool ftServer::handleTunnelRequest(const RsFileHash& hash,const RsPeerId& peer_id)
|
||||
{
|
||||
FileInfo info ;
|
||||
bool res = FileDetails(hash, RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY | RS_FILE_HINTS_DOWNLOAD, info);
|
||||
FileInfo info ;
|
||||
bool res = FileDetails(hash, RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, info);
|
||||
|
||||
if( (!res) && FileDetails(hash,RS_FILE_HINTS_DOWNLOAD,info))
|
||||
{
|
||||
// This file is currently being downloaded. Let's look if we already have a chunk or not. If not, no need to
|
||||
// share the file!
|
||||
|
||||
FileChunksInfo info2 ;
|
||||
if(rsFiles->FileDownloadChunksDetails(hash, info2))
|
||||
for(uint32_t i=0;i<info2.chunks.size();++i)
|
||||
if(info2.chunks[i] == FileChunksInfo::CHUNK_DONE)
|
||||
{
|
||||
res = true ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer: performing local hash search for hash " << hash << std::endl;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue