mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-11 17:04:31 -05:00
removed deadlock situation in data multiplex
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@3185 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
10565a1fe7
commit
1c9bcb53e8
@ -494,24 +494,29 @@ bool ftDataMultiplex::handleRecvData(const std::string& peerId,
|
|||||||
const std::string& hash, uint64_t size,
|
const std::string& hash, uint64_t size,
|
||||||
uint64_t offset, uint32_t chunksize, void *data)
|
uint64_t offset, uint32_t chunksize, void *data)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
ftTransferModule *transfer_module = NULL ;
|
||||||
std::map<std::string, ftClient>::iterator it;
|
|
||||||
if (mClients.end() == (it = mClients.find(hash)))
|
|
||||||
{
|
{
|
||||||
|
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||||
|
std::map<std::string, ftClient>::iterator it;
|
||||||
|
if (mClients.end() == (it = mClients.find(hash)))
|
||||||
|
{
|
||||||
#ifdef MPLEX_DEBUG
|
#ifdef MPLEX_DEBUG
|
||||||
std::cerr << "ftDataMultiplex::handleRecvData() ERROR: No matching Client!";
|
std::cerr << "ftDataMultiplex::handleRecvData() ERROR: No matching Client!";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
/* error */
|
/* error */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MPLEX_DEBUG
|
#ifdef MPLEX_DEBUG
|
||||||
std::cerr << "ftDataMultiplex::handleRecvData() Passing to Module";
|
std::cerr << "ftDataMultiplex::handleRecvData() Passing to Module";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(it->second).mModule->recvFileData(peerId, offset, chunksize, data);
|
transfer_module = (it->second).mModule ;
|
||||||
|
}
|
||||||
|
transfer_module->recvFileData(peerId, offset, chunksize, data);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user