Skip to content

Commit 8c62a9b

Browse files
committed
bug fix
1 parent b1dff5c commit 8c62a9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kcp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func (kcp *KCP) Recv(buffer []byte) (n int) {
273273
count = 0
274274
for k := range kcp.rcv_buf {
275275
seg := &kcp.rcv_buf[k]
276-
if seg.sn == kcp.rcv_nxt && len(kcp.rcv_queue) < int(kcp.rcv_wnd) {
276+
if seg.sn == kcp.rcv_nxt && len(kcp.rcv_queue)+count < int(kcp.rcv_wnd) {
277277
kcp.rcv_nxt++
278278
count++
279279
} else {
@@ -496,7 +496,7 @@ func (kcp *KCP) parse_data(newseg segment) bool {
496496
count := 0
497497
for k := range kcp.rcv_buf {
498498
seg := &kcp.rcv_buf[k]
499-
if seg.sn == kcp.rcv_nxt && len(kcp.rcv_queue) < int(kcp.rcv_wnd) {
499+
if seg.sn == kcp.rcv_nxt && len(kcp.rcv_queue)+count < int(kcp.rcv_wnd) {
500500
kcp.rcv_nxt++
501501
count++
502502
} else {

0 commit comments

Comments
 (0)