mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-29 13:51:51 +02:00
Disconnect from Control D without checking pin for app restarts
This commit is contained in:
1 parent
69ee6582e2
commit
6604f973ac
1 file changed
+7
-2
@@ -61,8 +61,13 @@ func mapCallback(callback AppCallback) cli.AppCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) Stop(Pin int64) int {
|
func (c *Controller) Stop(restart bool, pin int64) int {
|
||||||
errorCode := cli.CheckDeactivationPin(Pin, c.stopCh)
|
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 {
|
if errorCode == 0 && c.stopCh != nil {
|
||||||
close(c.stopCh)
|
close(c.stopCh)
|
||||||
c.stopCh = nil
|
c.stopCh = nil
|
||||||
|
|||||||
Reference in new issue
Block a user