mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Disconnect from Control D without checking pin for app restarts
This commit is contained in:
committed by
Cuong Manh Le
parent
69ee6582e2
commit
6604f973ac
@@ -61,8 +61,13 @@ func mapCallback(callback AppCallback) cli.AppCallback {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) Stop(Pin int64) int {
|
||||
errorCode := cli.CheckDeactivationPin(Pin, c.stopCh)
|
||||
func (c *Controller) Stop(restart bool, pin int64) int {
|
||||
var errorCode = 0
|
||||
// Force disconnect without checking pin.
|
||||
// In iOS restart is required if vpn detects no connectivity after network change.
|
||||
if !restart {
|
||||
errorCode = cli.CheckDeactivationPin(pin, c.stopCh)
|
||||
}
|
||||
if errorCode == 0 && c.stopCh != nil {
|
||||
close(c.stopCh)
|
||||
c.stopCh = nil
|
||||
|
||||
Reference in New Issue
Block a user