mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-19 08:17:01 +02:00
Struct Engine has methods on both value (#934)
Struct Engine has methods on both value and pointer receivers. Such usage is not recommended by the Go Documentation.
This commit is contained in:
parent
511f0a00be
commit
dd69c1cd31
@ -793,14 +793,14 @@ func (e *Engine) connWorker(conn *peer.Conn, peerKey string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e Engine) peerExists(peerKey string) bool {
|
func (e *Engine) peerExists(peerKey string) bool {
|
||||||
e.syncMsgMux.Lock()
|
e.syncMsgMux.Lock()
|
||||||
defer e.syncMsgMux.Unlock()
|
defer e.syncMsgMux.Unlock()
|
||||||
_, ok := e.peerConns[peerKey]
|
_, ok := e.peerConns[peerKey]
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e Engine) createPeerConn(pubKey string, allowedIPs string) (*peer.Conn, error) {
|
func (e *Engine) createPeerConn(pubKey string, allowedIPs string) (*peer.Conn, error) {
|
||||||
log.Debugf("creating peer connection %s", pubKey)
|
log.Debugf("creating peer connection %s", pubKey)
|
||||||
var stunTurn []*ice.URL
|
var stunTurn []*ice.URL
|
||||||
stunTurn = append(stunTurn, e.STUNs...)
|
stunTurn = append(stunTurn, e.STUNs...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user