1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

send more ack seg

This commit is contained in:
Darien Raymond 2016-11-29 08:31:19 +01:00
parent 2dc74faf19
commit 3be9519ed4
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -104,7 +104,7 @@ func (v *AckList) Flush(current uint32, rto uint32) {
v.flushCandidates = v.flushCandidates[:0]
seg := NewAckSegment()
for i := 0; i < len(v.numbers) && !seg.IsFull(); i++ {
for i := 0; i < len(v.numbers); i++ {
if v.nextFlush[i] > current {
if len(v.flushCandidates) < cap(v.flushCandidates) {
v.flushCandidates = append(v.flushCandidates, v.numbers[i])
@ -118,6 +118,12 @@ func (v *AckList) Flush(current uint32, rto uint32) {
timeout = 20
}
v.nextFlush[i] = current + timeout
if seg.IsFull() {
v.writer.Write(seg)
seg.Release()
seg = NewAckSegment()
}
}
if seg.Count > 0 {
for _, number := range v.flushCandidates {