Skip to content

Commit 5f6bbe4

Browse files
committed
conn: windows: reset ring to starting position after free
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 75526d6 commit 5f6bbe4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

conn/bind_windows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ func (ring *ringBuffer) CloseAndZero() {
197197
windows.VirtualFree(ring.packets, 0, windows.MEM_RELEASE)
198198
ring.packets = 0
199199
}
200+
ring.head = 0
201+
ring.tail = 0
202+
ring.isFull = false
200203
}
201204

202205
func (bind *afWinRingBind) CloseAndZero() {

0 commit comments

Comments
 (0)