mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-21 10:18:50 +02:00
Rename variable
This commit is contained in:
parent
9ee062b4d1
commit
a31d43a14c
@ -89,10 +89,10 @@ type Conn struct {
|
|||||||
onConnected func(remoteWireGuardKey string, remoteRosenpassPubKey []byte, wireGuardIP string, remoteRosenpassAddr string)
|
onConnected func(remoteWireGuardKey string, remoteRosenpassPubKey []byte, wireGuardIP string, remoteRosenpassAddr string)
|
||||||
onDisconnected func(remotePeer string, wgIP string)
|
onDisconnected func(remotePeer string, wgIP string)
|
||||||
|
|
||||||
statusRelay ConnStatus
|
statusRelay ConnStatus
|
||||||
statusICE ConnStatus
|
statusICE ConnStatus
|
||||||
currentConnType ConnPriority
|
currentConnPriority ConnPriority
|
||||||
opened bool // this flag is used to prevent close in case of not opened connection
|
opened bool // this flag is used to prevent close in case of not opened connection
|
||||||
|
|
||||||
workerICE *WorkerICE
|
workerICE *WorkerICE
|
||||||
workerRelay *WorkerRelay
|
workerRelay *WorkerRelay
|
||||||
@ -406,7 +406,7 @@ func (conn *Conn) iCEConnectionIsReady(priority ConnPriority, iceConnInfo ICECon
|
|||||||
|
|
||||||
defer conn.updateIceState(iceConnInfo)
|
defer conn.updateIceState(iceConnInfo)
|
||||||
|
|
||||||
if conn.currentConnType > priority {
|
if conn.currentConnPriority > priority {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ func (conn *Conn) iCEConnectionIsReady(priority ConnPriority, iceConnInfo ICECon
|
|||||||
}
|
}
|
||||||
conn.wgProxyICE = wgProxy
|
conn.wgProxyICE = wgProxy
|
||||||
|
|
||||||
conn.currentConnType = priority
|
conn.currentConnPriority = priority
|
||||||
|
|
||||||
conn.doOnConnected(iceConnInfo.RosenpassPubKey, iceConnInfo.RosenpassAddr)
|
conn.doOnConnected(iceConnInfo.RosenpassPubKey, iceConnInfo.RosenpassAddr)
|
||||||
}
|
}
|
||||||
@ -511,9 +511,9 @@ func (conn *Conn) relayConnectionIsReady(rci RelayConnInfo) {
|
|||||||
|
|
||||||
defer conn.updateRelayStatus(rci.relayedConn.RemoteAddr().String(), rci.rosenpassPubKey)
|
defer conn.updateRelayStatus(rci.relayedConn.RemoteAddr().String(), rci.rosenpassPubKey)
|
||||||
|
|
||||||
if conn.currentConnType > connPriorityRelay {
|
if conn.currentConnPriority > connPriorityRelay {
|
||||||
if conn.statusICE == StatusConnected {
|
if conn.statusICE == StatusConnected {
|
||||||
log.Debugf("do not switch to relay because current priority is: %v", conn.currentConnType)
|
log.Debugf("do not switch to relay because current priority is: %v", conn.currentConnPriority)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,7 +540,7 @@ func (conn *Conn) relayConnectionIsReady(rci RelayConnInfo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
conn.wgProxyRelay = wgProxy
|
conn.wgProxyRelay = wgProxy
|
||||||
conn.currentConnType = connPriorityRelay
|
conn.currentConnPriority = connPriorityRelay
|
||||||
|
|
||||||
conn.log.Infof("start to communicate with peer via relay")
|
conn.log.Infof("start to communicate with peer via relay")
|
||||||
conn.doOnConnected(rci.rosenpassPubKey, rci.rosenpassAddr)
|
conn.doOnConnected(rci.rosenpassPubKey, rci.rosenpassAddr)
|
||||||
@ -672,7 +672,7 @@ func (conn *Conn) isRelayed() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if conn.currentConnType == connPriorityICEP2P {
|
if conn.currentConnPriority == connPriorityICEP2P {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user