mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-21 18:22:37 +02:00
Fix double unlock in client.go
This commit is contained in:
parent
57ddb5f262
commit
9d44a476c6
@ -79,16 +79,14 @@ func (c *Client) Connect() error {
|
||||
defer c.readLoopMutex.Unlock()
|
||||
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
if c.serviceIsRunning {
|
||||
c.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
c.mu.Unlock()
|
||||
|
||||
err := c.connect()
|
||||
if err != nil {
|
||||
c.mu.Unlock()
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ func DetermineClientMsgType(msg []byte) (MsgType, error) {
|
||||
case MsgTypeTransport:
|
||||
return msgType, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("invalid msg type: %s", msg)
|
||||
return 0, fmt.Errorf("invalid msg type, len: %d", len(msg))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user