mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-13 03:22:34 -04:00
added some safety checks to setting chunk strategy against inconsistent values.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3236 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f7ff141a37
commit
c8fc75c75c
3 changed files with 19 additions and 3 deletions
|
@ -919,6 +919,9 @@ bool ftController::handleAPendingRequest()
|
|||
req = mPendingRequests.front();
|
||||
mPendingRequests.pop_front();
|
||||
}
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "Requesting pending hash " << req.mHash << std::endl ;
|
||||
#endif
|
||||
|
||||
FileRequest(req.mName, req.mHash, req.mSize, req.mDest, req.mFlags, req.mSrcIds);
|
||||
|
||||
|
@ -942,6 +945,10 @@ bool ftController::handleAPendingRequest()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "Hash " << req.mHash << " is in downloads" << std::endl ;
|
||||
std::cerr << " setting chunk strategy to " << rsft->chunk_strategy << std::endl;
|
||||
#endif
|
||||
(fit->second)->mCreator->setAvailabilityMap(rsft->compressed_chunk_map) ;
|
||||
(fit->second)->mCreator->setChunkStrategy((FileChunksInfo::ChunkStrategy)(rsft->chunk_strategy)) ;
|
||||
}
|
||||
|
@ -949,6 +956,10 @@ bool ftController::handleAPendingRequest()
|
|||
delete rsft ;
|
||||
mPendingChunkMaps.erase(it) ;
|
||||
}
|
||||
#ifdef CONTROL_DEBUG
|
||||
else
|
||||
std::cerr << "No pending chunkmap for hash " << req.mHash << std::endl ;
|
||||
#endif
|
||||
}
|
||||
|
||||
return true ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue