From e533379e43fa952575ac317618a896f132764a6a Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Wed, 21 Oct 2020 19:06:35 -0500 Subject: [PATCH] fix: respect the configured receive window the count should be less than the configured receive window, not the default receive window --- ikcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ikcp.c b/ikcp.c index fd4cf7d8..3e0cb2f1 100644 --- a/ikcp.c +++ b/ikcp.c @@ -507,7 +507,7 @@ int ikcp_send(ikcpcb *kcp, const char *buffer, int len) if (len <= (int)kcp->mss) count = 1; else count = (len + kcp->mss - 1) / kcp->mss; - if (count >= (int)IKCP_WND_RCV) return -2; + if (count >= (int)kcp->rcv_wnd) return -2; if (count == 0) count = 1;