[PATCH] Windows Bindings: handler for WSAEMSGSIZE added to avoid stop receiving data

Sascha Dierberg sascha.dierberg at gmail.com
Sat Apr 24 13:33:32 UTC 2021


From: Sascha Dierberg <dierberg at dresearch-fe.de>

Signed-off-by: Sascha Dierberg <dierberg at dresearch-fe.de>
---
 conn/bind_windows.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/conn/bind_windows.go b/conn/bind_windows.go
index fdd1c24..e78bef9 100644
--- a/conn/bind_windows.go
+++ b/conn/bind_windows.go
@@ -389,6 +389,10 @@ func (bind *afWinRingBind) Receive(buf []byte,
isOpen *uint32) (int, Endpoint, e
  if err != nil {
  return 0, nil, err
  }
+ // WSAEMSGSIZE message too long error on Winsock2
+ if results[0].Status == 10040 {
+ return 0, nil, nil
+ }
  if results[0].Status != 0 {
  return 0, nil, windows.Errno(results[0].Status)
  }
-- 
2.31.1


More information about the WireGuard mailing list