Improved multi-source file transfer in two ways:

- tunnels can borrow data chunks from only slower tunnels, to prevent blocking fast tunnels
- tunnels can handle up to 50 data chunks at once instead of 5
Multi-source transfers are generaly faster and more stable.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5156 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-05-09 21:31:05 +00:00
parent 438651f693
commit f5c345659a
2 changed files with 40 additions and 16 deletions

View file

@ -9,7 +9,7 @@
******/
#define CHUNK_MAX_AGE 40
#define MAX_FTCHUNKS_PER_PEER 5
#define MAX_FTCHUNKS_PER_PEER 50
/***********************************************************
*
@ -366,7 +366,7 @@ int ftFileCreator::locked_notifyReceived(uint64_t offset, uint32_t chunk_size)
if(!found)
{
std::cerr << "ftFileCreator::locked_notifyReceived(): failed to find an active slice for " << offset << "+" << chunk_size << ": dropping data." << std::endl;
std::cerr << "ftFileCreator::locked_notifyReceived(): failed to find an active slice for " << offset << "+" << chunk_size << ", hash = " << hash << ": dropping data." << std::endl;
return 0; /* ignoring */
}
}
@ -466,7 +466,7 @@ bool ftFileCreator::getMissingChunk(const std::string& peer_id,uint32_t size_hin
if(chunks_for_this_peer >= MAX_FTCHUNKS_PER_PEER)
{
#ifdef FILE_DEBUG
std::cerr << "ffc::getMissingChunk() too many chunks for peer " << peer_id << std::endl ;
std::cerr << "ffc::getMissingChunk() too many chunks for peer " << peer_id << " for hash " << hash << ". Count = " << chunks_for_this_peer << std::endl ;
#endif
return false ;
}