mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -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;
|
||||
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;
|
||||
else
|
||||
break;
|
||||
case RS_HIDDEN_TYPE_TOR:
|
||||
default:
|
||||
/* default 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
|
||||
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_port = it->second.hiddenPort;
|
||||
|
||||
if(it->second.hiddenType == RS_HIDDEN_TYPE_I2P)
|
||||
switch (it->second.hiddenType) {
|
||||
case RS_HIDDEN_TYPE_I2P:
|
||||
proxy_addr = mProxyServerAddressI2P;
|
||||
else
|
||||
break;
|
||||
case RS_HIDDEN_TYPE_TOR:
|
||||
default:
|
||||
/* default tor */
|
||||
proxy_addr = mProxyServerAddressTor;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user