Skip to content

Commit 6fed5a9

Browse files
committed
add a comment for seg.acked
1 parent 80999c7 commit 6fed5a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kcp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ func (kcp *KCP) parse_ack(sn uint32) {
399399
for k := range kcp.snd_buf {
400400
seg := &kcp.snd_buf[k]
401401
if sn == seg.sn {
402+
// mark and free space, but leave the segment here,
403+
// and wait until `una` to delete this, then we don't
404+
// have to shift the segments behind forward,
405+
// which is an expensive operation for large window
402406
seg.acked = 1
403407
kcp.delSegment(seg)
404408
break

0 commit comments

Comments
 (0)