Skip to content

Commit

Permalink
add a comment for seg.acked
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Mar 21, 2019
1 parent 80999c7 commit 6fed5a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ func (kcp *KCP) parse_ack(sn uint32) {
for k := range kcp.snd_buf {
seg := &kcp.snd_buf[k]
if sn == seg.sn {
// mark and free space, but leave the segment here,
// and wait until `una` to delete this, then we don't
// have to shift the segments behind forward,
// which is an expensive operation for large window
seg.acked = 1
kcp.delSegment(seg)
break
Expand Down

0 comments on commit 6fed5a9

Please sign in to comment.