Skip to content

Commit

Permalink
Merge pull request #642 from Darkren/fix/vpn-duplicates
Browse files Browse the repository at this point in the history
Fix VPN client duplicates
  • Loading branch information
jdknives authored Dec 17, 2020
2 parents 3dad35d + e868c9a commit 5b0f027
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/vpn/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,25 @@ func (c *Client) dialServer(appCl *app.Client, pk cipher.PubKey) (net.Conn, erro
PubKey: pk,
Port: vpnPort,
})

if c.isClosed() {
// in this case client got closed, we return no error,
// so that retrier could stop gracefully
return nil
}

return err
})
if err != nil {
return nil, err
}

if c.isClosed() {
// we need to signal outer code that connection object is inalid
// in this case
return nil, errors.New("client got closed")
}

return conn, nil
}

Expand Down

0 comments on commit 5b0f027

Please sign in to comment.