mirror of
https://github.com/skywind3000/kcp.git
synced 2025-03-22 07:22:59 +08:00
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:
parent
2163e05b13
commit
e533379e43
2
ikcp.c
2
ikcp.c
@ -507,7 +507,7 @@ int ikcp_send(ikcpcb *kcp, const char *buffer, int len)
|
|||||||
if (len <= (int)kcp->mss) count = 1;
|
if (len <= (int)kcp->mss) count = 1;
|
||||||
else count = (len + kcp->mss - 1) / kcp->mss;
|
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;
|
if (count == 0) count = 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user