]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
tun: windows: do not sleep after OPERATION_ABORTED on write
authorSimon Rozman <simon@rozman.si>
Thu, 11 Apr 2019 17:37:04 +0000 (19:37 +0200)
committerSimon Rozman <simon@rozman.si>
Thu, 11 Apr 2019 17:37:04 +0000 (19:37 +0200)
Signed-off-by: Simon Rozman <simon@rozman.si>
tun/tun_windows.go

index 0f39d013045aed65b6c9a9fc7379127888b83763..e55fa6ffa5fc66c02aa0e24abe43f3e5097db605 100644 (file)
@@ -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
                                }