mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-17 10:59:38 -04:00
branch commit 3185: removed deadlock situation in data multiplex
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3186 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d6625a15b8
commit
531567997d
1 changed files with 17 additions and 12 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue