1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-28 23:06:14 -04:00

refactor code

This commit is contained in:
v2ray 2016-07-03 09:38:51 +02:00
parent f8a614714c
commit 0eaa3ba27a
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -255,19 +255,11 @@ func (this *ReceivingWorker) ProcessSegment(seg *DataSegment) {
this.ProcessSendingNext(seg.SendingNext)
this.acklist.Add(number, seg.Timestamp)
this.windowMutex.Lock()
defer this.windowMutex.Unlock()
if !this.window.Set(idx, seg) {
seg.Release()
}
this.windowMutex.Unlock()
this.DumpWindow()
}
// @Private
func (this *ReceivingWorker) DumpWindow() {
this.windowMutex.Lock()
defer this.windowMutex.Unlock()
for {
seg := this.window.RemoveFirst()