summaryrefslogtreecommitdiffhomepage
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-09 07:36:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-09 07:36:03 +0200
commite680008700e4a187c6f13ccc1ba4c9aeac8dddf9 (patch)
tree9d370d1b69dd3f081e9efaeb4911e13e6ed6b671 /tun/tun_windows.go
parent767c86f8cb9388486fbcde8b0aa66a2b10cf3e2b (diff)
tun: windows: do not sleep after OPERATION_ABORTED
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index 386b518..0f39d01 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -259,7 +259,7 @@ func (tun *NativeTun) Read(buff []byte, offset int) (int, error) {
}
// Fill queue.
- retries := retryTimeout * retryRate
+ retries := 1000
for {
n, err := file.Read(tun.rdBuff.data[:])
if err != nil {
@@ -270,7 +270,6 @@ func (tun *NativeTun) Read(buff []byte, offset int) (int, error) {
return 0, os.ErrClosed
}
if retries > 0 && ok && pe.Err == windows.ERROR_OPERATION_ABORTED {
- time.Sleep(time.Second / retryRate)
retries--
continue
}