From a291fdd7462768dd54e433f8319c780448a44f7d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 11 Apr 2019 19:37:04 +0200 Subject: tun: windows: do not sleep after OPERATION_ABORTED on write Signed-off-by: Simon Rozman --- tun/tun_windows.go | 3 +-- 1 file changed, 1 insertion(+), 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 } -- cgit v1.2.3