summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/registryhacks_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-02 23:53:15 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-02 23:53:15 +0200
commit46dbf5404013e83867356ea8a590a45a569acbf4 (patch)
tree0759e6ea30009538fdb458170d0bd632b63de8ee /tun/wintun/registryhacks_windows.go
parent247e14693adb3d7a337ec57a4d2db374fb9099cd (diff)
wintun: don't retry when not creating
The only time we're trying to counteract the race condition is when we're creating a driver. When we're simply looking up all drivers, it doesn't make sense to retry.
Diffstat (limited to 'tun/wintun/registryhacks_windows.go')
-rw-r--r--tun/wintun/registryhacks_windows.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/tun/wintun/registryhacks_windows.go b/tun/wintun/registryhacks_windows.go
index bbcc020..94cc2f3 100644
--- a/tun/wintun/registryhacks_windows.go
+++ b/tun/wintun/registryhacks_windows.go
@@ -11,7 +11,7 @@ import (
)
const (
- numRetries = 100
+ numRetries = 100
retryTimeout = 150 * time.Millisecond
)
@@ -21,7 +21,7 @@ func registryOpenKeyRetry(k registry.Key, path string, access uint32) (key regis
if err == nil {
break
}
- if i != numRetries - 1 {
+ if i != numRetries-1 {
time.Sleep(retryTimeout)
}
}
@@ -34,7 +34,7 @@ func keyGetStringValueRetry(k registry.Key, name string) (val string, valtype ui
if err == nil {
break
}
- if i != numRetries - 1 {
+ if i != numRetries-1 {
time.Sleep(retryTimeout)
}
}