]> Cypherpunks.ru repositories - govpn.git/commitdiff
Ability to disable client reconnection
authorSergey Matveev <stargrave@stargrave.org>
Sun, 3 Jul 2016 08:58:08 +0000 (11:58 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 3 Jul 2016 08:58:08 +0000 (11:58 +0300)
doc/client.texi
src/cypherpunks.ru/govpn/cmd/govpn-client/main.go

index d3a7f418bb73bb807bc8ea4bc945861bfecbb600..58dc74bb2f3a8f3bd1e549769e0dfd7766a9e62d 100644 (file)
@@ -37,6 +37,9 @@ to enter it in the terminal.
 @item -timeout
 @ref{Timeout} setting in seconds.
 
+@item -noreconnect
+Disable reconnection after timeout.
+
 @item -timesync
 Optional @ref{Timesync, time synchronization} requirement. If set to
 zero, then no synchronization required.
index 7a858bba79eef5cbe868111462a11f77b7a9a80d..98a5b21e6418953620a6b262e02ce69a028bb98b 100644 (file)
@@ -45,6 +45,7 @@ var (
        mtu         = flag.Int("mtu", govpn.MTUDefault, "MTU of TAP interface")
        timeoutP    = flag.Int("timeout", 60, "Timeout seconds")
        timeSync    = flag.Int("timesync", 0, "Time synchronization requirement")
+       noreconnect = flag.Bool("noreconnect", false, "Disable reconnection after timeout")
        noisy       = flag.Bool("noise", false, "Enable noise appending")
        encless     = flag.Bool("encless", false, "Encryptionless mode")
        cpr         = flag.Int("cpr", 0, "Enable constant KiB/sec out traffic rate")
@@ -161,6 +162,9 @@ MainCycle:
                        termination <- struct{}{}
                        break MainCycle
                case <-timeouted:
+                       if *noreconnect {
+                               break MainCycle
+                       }
                        govpn.BothPrintf(`[sleep seconds="%d"]`, timeout)
                        time.Sleep(time.Second * time.Duration(timeout))
                case <-rehandshaking: