Skip to content

Commit

Permalink
fixed a bug on ack.sn math
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jan 29, 2020
1 parent fcb4d60 commit 6a7b9a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ func (kcp *KCP) flush(ackOnly bool) uint32 {
for i, ack := range kcp.acklist {
makeSpace(IKCP_OVERHEAD)
// filter jitters caused by bufferbloat
if ack.sn >= kcp.rcv_nxt || len(kcp.acklist)-1 == i {
if _itimediff(ack.sn, kcp.rcv_nxt) >= 0 || len(kcp.acklist)-1 == i {
seg.sn, seg.ts = ack.sn, ack.ts
ptr = seg.encode(ptr)
}
Expand Down

0 comments on commit 6a7b9a7

Please sign in to comment.