소스 검색

min timeout

Darien Raymond 9 년 전
부모
커밋
e72f8a26c8
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      transport/internet/kcp/receiving.go

+ 5 - 1
transport/internet/kcp/receiving.go

@@ -102,7 +102,11 @@ func (this *AckList) Flush(current uint32, rto uint32) {
 		if this.nextFlush[i] <= current {
 			seg.PutNumber(this.numbers[i])
 			seg.PutTimestamp(this.timestamps[i])
-			this.nextFlush[i] = current + rto/4
+			timeout := rto / 4
+			if timeout < 20 {
+				timeout = 20
+			}
+			this.nextFlush[i] = current + timeout
 		}
 	}
 	if seg.Count > 0 {