mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-12-23 22:38:48 +01:00
tun: windows: do not sleep after OPERATION_ABORTED on write
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
d50e390904
commit
a291fdd746
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user