Merge pull request #2017 from hunbernd/fix/torstartup

Fix hidden node crashing at the startup
This commit is contained in:
csoler 2020-06-21 22:42:38 +02:00 committed by GitHub
commit 947b2a3f51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -1803,8 +1803,9 @@ void p3NetMgrIMPL::updateNatSetting()
#endif #endif
#ifdef RS_USE_DHT_STUNNER #ifdef RS_USE_DHT_STUNNER
switch(natType) if (mProxyStunner) {
{ switch(natType)
{
case RSNET_NATTYPE_RESTRICTED_CONE: case RSNET_NATTYPE_RESTRICTED_CONE:
{ {
if ((natHole == RSNET_NATHOLE_NONE) || (natHole == RSNET_NATHOLE_UNKNOWN)) if ((natHole == RSNET_NATHOLE_NONE) || (natHole == RSNET_NATHOLE_UNKNOWN))
@ -1826,6 +1827,7 @@ void p3NetMgrIMPL::updateNatSetting()
mProxyStunner->setRefreshPeriod(NET_STUNNER_PERIOD_SLOW); mProxyStunner->setRefreshPeriod(NET_STUNNER_PERIOD_SLOW);
break; break;
}
} }
#endif // RS_USE_DHT_STUNNER #endif // RS_USE_DHT_STUNNER

View file

@ -291,8 +291,8 @@ private:
//p3BitDht *mBitDht; //p3BitDht *mBitDht;
#ifdef RS_USE_DHT_STUNNER #ifdef RS_USE_DHT_STUNNER
pqiAddrAssist *mDhtStunner; pqiAddrAssist *mDhtStunner = nullptr;
pqiAddrAssist *mProxyStunner; pqiAddrAssist *mProxyStunner = nullptr;
#endif // RS_USE_DHT_STUNNER #endif // RS_USE_DHT_STUNNER
RsMutex mNetMtx; /* protects below */ RsMutex mNetMtx; /* protects below */