aboutsummaryrefslogtreecommitdiffstats
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-04-11 19:37:04 +0200
committerSimon Rozman <simon@rozman.si>2019-04-11 19:37:04 +0200
commita291fdd7462768dd54e433f8319c780448a44f7d (patch)
tree38f1c241dbfa4e2558b231acc4193a63f9e68d7a /tun/tun_windows.go
parentmain_windows: use proper version constant (diff)
downloadwireguard-go-a291fdd7462768dd54e433f8319c780448a44f7d.tar.xz
wireguard-go-a291fdd7462768dd54e433f8319c780448a44f7d.zip
tun: windows: do not sleep after OPERATION_ABORTED on write
Signed-off-by: Simon Rozman <simon@rozman.si>
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 0f39d01..e55fa6f 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -301,7 +301,7 @@ func (tun *NativeTun) Flush() error {
}
// Flush write buffer.
- retries := retryTimeout * retryRate
+ retries := 1000
for {
_, err = file.Write(tun.wrBuff.data[:tun.wrBuff.offset])
tun.wrBuff.packetNum = 0
@@ -312,7 +312,6 @@ func (tun *NativeTun) Flush() error {
return os.ErrClosed
}
if retries > 0 && ok && pe.Err == windows.ERROR_OPERATION_ABORTED {
- time.Sleep(time.Second / retryRate)
retries--
continue
}