From 5846b622837e04dbc35b153d9ceda7fd66397520 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 11 May 2021 16:47:17 +0200 Subject: [PATCH] conn: windows: set count=0 on retry When retrying, if count is not 0, we forget to dequeue another request, and so the ring fills up and errors out. Reported-by: Sascha Dierberg Signed-off-by: Jason A. Donenfeld --- conn/bind_windows.go | 1 + 1 file changed, 1 insertion(+) diff --git a/conn/bind_windows.go b/conn/bind_windows.go index 42208b1..d744987 100644 --- a/conn/bind_windows.go +++ b/conn/bind_windows.go @@ -357,6 +357,7 @@ func (bind *afWinRingBind) Receive(buf []byte, isOpen *uint32) (int, Endpoint, e var count uint32 var results [1]winrio.Result retry: + count = 0 for tries := 0; count == 0 && tries < receiveSpins; tries++ { if tries > 0 { if atomic.LoadUint32(isOpen) != 1 {