1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00

simplify logic

This commit is contained in:
v2ray 2016-07-03 00:38:33 +02:00
parent e5c4fd3e1c
commit 84889117e9
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -248,15 +248,13 @@ func (this *ReceivingWorker) ProcessSendingNext(number uint32) {
func (this *ReceivingWorker) ProcessSegment(seg *DataSegment) {
number := seg.Number
if _itimediff(number, this.nextNumber+this.windowSize) >= 0 || _itimediff(number, this.nextNumber) < 0 {
idx := number - this.nextNumber
if idx >= this.windowSize {
return
}
this.ProcessSendingNext(seg.SendingNext)
this.acklist.Add(number, seg.Timestamp)
this.windowMutex.Lock()
idx := number - this.nextNumber
if !this.window.Set(idx, seg) {
seg.Release()