mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added a check to avoid (possibly rare) data races
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e8f5bb5167
commit
48556396ee
@ -478,7 +478,11 @@ bool ftDataMultiplex::handleRecvServerChunkMapRequest(const std::string& peerId,
|
||||
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||
|
||||
it = mServers.find(hash) ;
|
||||
it->second->getAvailabilityMap(cmap);
|
||||
|
||||
if(it == mServers.end()) // handleSearchRequest should have filled mServers[hash], but we have been off-mutex since,
|
||||
return false ; // so it's safer to check again.
|
||||
else
|
||||
it->second->getAvailabilityMap(cmap);
|
||||
}
|
||||
|
||||
mDataSend->sendChunkMap(peerId,hash,cmap);
|
||||
|
Loading…
Reference in New Issue
Block a user