summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-05-11 16:47:17 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-05-11 16:47:17 +0200
commit5846b622837e04dbc35b153d9ceda7fd66397520 (patch)
treeabf78d154e11c6df4ef83db7fc9cb2edaa8f4d1b
parent9844c74f67ecb5dcca92646dd2c23fcfa21c0703 (diff)
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 <dierberg@dresearch-fe.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--conn/bind_windows.go1
1 files changed, 1 insertions, 0 deletions
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 {