fix: respect the configured receive window

the count should be less than the configured receive window,  not the default receive window
This commit is contained in:
Paul Pacheco 2020-10-21 19:06:35 -05:00 committed by GitHub
parent 2163e05b13
commit e533379e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
ikcp.c
View File

@ -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;