mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-21 12:51:09 -05:00
added a check to avoid (possibly rare) data races
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
73343f9250
commit
37a2bfb8de
@ -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