mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
improve sending performance
This commit is contained in:
parent
6f998fa18b
commit
0acd3b6d62
@ -206,6 +206,9 @@ func (this *SendingQueue) Pop() *alloc.Buffer {
|
||||
if this.start == this.cap {
|
||||
this.start = 0
|
||||
}
|
||||
if this.IsEmpty() {
|
||||
this.start = 0
|
||||
}
|
||||
return seg
|
||||
}
|
||||
|
||||
@ -301,6 +304,18 @@ func (this *SendingWorker) ProcessSegment(current uint32, seg *AckSegment) {
|
||||
this.remoteNextNumber = seg.ReceivingWindow
|
||||
}
|
||||
this.ProcessReceivingNextWithoutLock(seg.ReceivingNext)
|
||||
|
||||
for !this.queue.IsEmpty() && !this.window.IsFull() {
|
||||
seg := NewDataSegment()
|
||||
seg.Data = this.queue.Pop()
|
||||
seg.Number = this.nextNumber
|
||||
seg.timeout = current
|
||||
seg.ackSkipped = 0
|
||||
seg.transmit = 0
|
||||
this.window.Push(seg)
|
||||
this.nextNumber++
|
||||
}
|
||||
|
||||
var maxack uint32
|
||||
for i := 0; i < int(seg.Count); i++ {
|
||||
timestamp := seg.TimestampList[i]
|
||||
|
Loading…
Reference in New Issue
Block a user