mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
[client] Fix/nil relayed address (#4153)
Fix nil pointer in Relay conn address Meanwhile, we create a relayed net.Conn struct instance, it is possible to set the relayedURL to nil. panic: value method github.com/netbirdio/netbird/relay/client.RelayAddr.String called using nil *RelayAddr pointer Fix relayed URL variable protection Protect the channel closing
This commit is contained in:
@@ -24,8 +24,8 @@ func NewPeerNotifier(store *Store) *PeerNotifier {
|
||||
|
||||
func (pn *PeerNotifier) NewListener(onPeersComeOnline, onPeersWentOffline func([]messages.PeerID)) *Listener {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
listener := newListener(pn.store)
|
||||
go listener.listenForEvents(ctx, onPeersComeOnline, onPeersWentOffline)
|
||||
listener := newListener(ctx, pn.store)
|
||||
go listener.listenForEvents(onPeersComeOnline, onPeersWentOffline)
|
||||
|
||||
pn.listenersMutex.Lock()
|
||||
pn.listeners[listener] = cancel
|
||||
|
||||
Reference in New Issue
Block a user