wintun: Simplify Read method()
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
713477cfb1
commit
f05f52637f
|
@ -203,8 +203,9 @@ func (tun *nativeTun) Read(buff []byte, offset int) (int, error) {
|
|||
select {
|
||||
case err := <-tun.errors:
|
||||
return 0, err
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
for {
|
||||
if tun.rdNextPacket < tun.rdBuff.numPackets {
|
||||
// Get packet from the queue.
|
||||
|
@ -263,7 +264,6 @@ func (tun *nativeTun) Read(buff []byte, offset int) (int, error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Note: flush() and putTunPacket() assume the caller comes only from a single thread; there's no locking.
|
||||
|
||||
|
|
Loading…
Reference in a new issue