mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-29 16:53:31 -05:00
replaced some ifs with switch
This commit is contained in:
parent
fed43450ae
commit
4fc6c73dd9
@ -2026,11 +2026,16 @@ void p3LinkMgrIMPL::locked_ConnectAttempt_ProxyAddress(peerConnectState *peer,
|
|||||||
peerConnectAddress pca;
|
peerConnectAddress pca;
|
||||||
pca.addr = proxy_addr;
|
pca.addr = proxy_addr;
|
||||||
|
|
||||||
if (mPeerMgr->hiddenDomainToHiddenType(domain_addr) == RS_HIDDEN_TYPE_I2P)
|
switch (mPeerMgr->hiddenDomainToHiddenType(domain_addr)) {
|
||||||
|
case RS_HIDDEN_TYPE_I2P:
|
||||||
pca.type = RS_NET_CONN_TCP_HIDDEN_I2P;
|
pca.type = RS_NET_CONN_TCP_HIDDEN_I2P;
|
||||||
else
|
break;
|
||||||
|
case RS_HIDDEN_TYPE_TOR:
|
||||||
|
default:
|
||||||
/* default tor */
|
/* default tor */
|
||||||
pca.type = RS_NET_CONN_TCP_HIDDEN_TOR;
|
pca.type = RS_NET_CONN_TCP_HIDDEN_TOR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//for the delay, we add a random time and some more time when the friend list is big
|
//for the delay, we add a random time and some more time when the friend list is big
|
||||||
pca.delay = P3CONNMGR_TCP_DEFAULT_DELAY;
|
pca.delay = P3CONNMGR_TCP_DEFAULT_DELAY;
|
||||||
|
@ -637,11 +637,16 @@ bool p3PeerMgrIMPL::getProxyAddress(const RsPeerId &ssl_id, struct sockaddr_stor
|
|||||||
domain_addr = it->second.hiddenDomain;
|
domain_addr = it->second.hiddenDomain;
|
||||||
domain_port = it->second.hiddenPort;
|
domain_port = it->second.hiddenPort;
|
||||||
|
|
||||||
if(it->second.hiddenType == RS_HIDDEN_TYPE_I2P)
|
switch (it->second.hiddenType) {
|
||||||
|
case RS_HIDDEN_TYPE_I2P:
|
||||||
proxy_addr = mProxyServerAddressI2P;
|
proxy_addr = mProxyServerAddressI2P;
|
||||||
else
|
break;
|
||||||
|
case RS_HIDDEN_TYPE_TOR:
|
||||||
|
default:
|
||||||
/* default tor */
|
/* default tor */
|
||||||
proxy_addr = mProxyServerAddressTor;
|
proxy_addr = mProxyServerAddressTor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user