mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
remove a deadlock
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1822 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
573e7b2474
commit
6a48284c31
@ -740,33 +740,34 @@ void p3ConnectMgr::networkConsistencyCheck()
|
|||||||
oldnetFlagStunOk = netFlagStunOk;
|
oldnetFlagStunOk = netFlagStunOk;
|
||||||
oldnetFlagExtraAddressCheckOk = netFlagExtraAddressCheckOk;
|
oldnetFlagExtraAddressCheckOk = netFlagExtraAddressCheckOk;
|
||||||
|
|
||||||
//if ip adresses are different, let's use the stun address, then the extaddrfinder and then the upnp address.
|
if (!doNetReset) {//if ip adresses are different, let's use the stun address, then the extaddrfinder and then the upnp address.
|
||||||
struct sockaddr_in extAddr;
|
struct sockaddr_in extAddr;
|
||||||
if (getStunExtAddress(extAddr)) {
|
if (getStunExtAddress(extAddr)) {
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using STUN for ownState.serveraddr." << std::endl;
|
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using STUN for ownState.serveraddr." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ownState.currentserveraddr = extAddr;
|
ownState.currentserveraddr = extAddr;
|
||||||
} else {
|
} else {
|
||||||
//call the extrafinder address
|
//call the extrafinder address
|
||||||
if (getUpnpExtAddress(extAddr)) {
|
if (getUpnpExtAddress(extAddr)) {
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using getUpnpExtAddress for ownState.serveraddr." << std::endl;
|
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using getUpnpExtAddress for ownState.serveraddr." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ownState.currentserveraddr = extAddr;
|
ownState.currentserveraddr = extAddr;
|
||||||
} else if (getExtFinderExtAddress(extAddr)) {
|
} else if (getExtFinderExtAddress(extAddr)) {
|
||||||
netExtFinderAddressCheck(); //so we put the extra address flag ok.
|
netExtFinderAddressCheck(); //so we put the extra address flag ok.
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using getExtFinderExtAddress for ownState.serveraddr." << std::endl;
|
std::cerr << "p3ConnectMgr::networkConsistencyCheck() using getExtFinderExtAddress for ownState.serveraddr." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ownState.currentserveraddr = extAddr;
|
ownState.currentserveraddr = extAddr;
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::networkConsistencyCheck() no external ip address." << std::endl;
|
std::cerr << "p3ConnectMgr::networkConsistencyCheck() no external ip address." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
doNetReset = true;
|
doNetReset = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
connMtx.unlock(); /* UNLOCK MUTEX */
|
connMtx.unlock(); /* UNLOCK MUTEX */
|
||||||
|
|
||||||
@ -801,13 +802,11 @@ void p3ConnectMgr::netExtFinderAddressCheck()
|
|||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::netExtraAddressCheck() return true" << std::endl;
|
std::cerr << "p3ConnectMgr::netExtraAddressCheck() return true" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
|
||||||
netFlagExtraAddressCheckOk = true;
|
netFlagExtraAddressCheckOk = true;
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONN_DEBUG
|
#ifdef CONN_DEBUG
|
||||||
std::cerr << "p3ConnectMgr::netExtraAddressCheck() return false" << std::endl;
|
std::cerr << "p3ConnectMgr::netExtraAddressCheck() return false" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
|
||||||
netFlagExtraAddressCheckOk = false;
|
netFlagExtraAddressCheckOk = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user