mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 22:55:04 -04:00
optimizations
* reduced calls to mPeermgr * use switch convenience * small fixes
This commit is contained in:
parent
bfcf43f0e1
commit
d24b281948
7 changed files with 105 additions and 56 deletions
|
@ -617,20 +617,19 @@ int pqipersongrp::connectPeer(const RsPeerId& id
|
|||
uint32_t ptype;
|
||||
if (type & RS_NET_CONN_TCP_ALL)
|
||||
{
|
||||
if (type == RS_NET_CONN_TCP_HIDDEN_TOR)
|
||||
{
|
||||
switch (type) {
|
||||
case RS_NET_CONN_TCP_HIDDEN_TOR:
|
||||
ptype = PQI_CONNECT_HIDDEN_TOR_TCP;
|
||||
timeout = RS_TCP_HIDDEN_TIMEOUT_PERIOD;
|
||||
}
|
||||
else if (type == RS_NET_CONN_TCP_HIDDEN_I2P)
|
||||
{
|
||||
break;
|
||||
case RS_NET_CONN_TCP_HIDDEN_I2P:
|
||||
ptype = PQI_CONNECT_HIDDEN_I2P_TCP;
|
||||
timeout = RS_TCP_HIDDEN_TIMEOUT_PERIOD;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
default:
|
||||
ptype = PQI_CONNECT_TCP;
|
||||
timeout = RS_TCP_STD_TIMEOUT_PERIOD;
|
||||
timeout = RS_TCP_STD_TIMEOUT_PERIOD;
|
||||
break;
|
||||
}
|
||||
#ifdef PGRP_DEBUG
|
||||
std::cerr << " pqipersongrp::connectPeer() connecting with TCP: Timeout :" << timeout;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue