mirror of https://github.com/v2ray/v2ray-core
rename acklist
parent
e1ce179b8e
commit
3e84e4cb44
|
@ -46,7 +46,7 @@ type KCP struct {
|
||||||
snd_buf *SendingWindow
|
snd_buf *SendingWindow
|
||||||
rcv_buf *ReceivingWindow
|
rcv_buf *ReceivingWindow
|
||||||
|
|
||||||
acklist *ACKList
|
acklist *AckList
|
||||||
|
|
||||||
fastresend int32
|
fastresend int32
|
||||||
congestionControl bool
|
congestionControl bool
|
||||||
|
|
|
@ -148,15 +148,15 @@ func (this *ReceivingQueue) Close() {
|
||||||
close(this.queue)
|
close(this.queue)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ACKList struct {
|
type AckList struct {
|
||||||
kcp *KCP
|
kcp *KCP
|
||||||
timestamps []uint32
|
timestamps []uint32
|
||||||
numbers []uint32
|
numbers []uint32
|
||||||
nextFlush []uint32
|
nextFlush []uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewACKList(kcp *KCP) *ACKList {
|
func NewACKList(kcp *KCP) *AckList {
|
||||||
return &ACKList{
|
return &AckList{
|
||||||
kcp: kcp,
|
kcp: kcp,
|
||||||
timestamps: make([]uint32, 0, 32),
|
timestamps: make([]uint32, 0, 32),
|
||||||
numbers: make([]uint32, 0, 32),
|
numbers: make([]uint32, 0, 32),
|
||||||
|
@ -164,13 +164,13 @@ func NewACKList(kcp *KCP) *ACKList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ACKList) Add(number uint32, timestamp uint32) {
|
func (this *AckList) Add(number uint32, timestamp uint32) {
|
||||||
this.timestamps = append(this.timestamps, timestamp)
|
this.timestamps = append(this.timestamps, timestamp)
|
||||||
this.numbers = append(this.numbers, number)
|
this.numbers = append(this.numbers, number)
|
||||||
this.nextFlush = append(this.nextFlush, 0)
|
this.nextFlush = append(this.nextFlush, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ACKList) Clear(una uint32) {
|
func (this *AckList) Clear(una uint32) {
|
||||||
count := 0
|
count := 0
|
||||||
for i := 0; i < len(this.numbers); i++ {
|
for i := 0; i < len(this.numbers); i++ {
|
||||||
if this.numbers[i] >= una {
|
if this.numbers[i] >= una {
|
||||||
|
@ -189,7 +189,7 @@ func (this *ACKList) Clear(una uint32) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ACKList) Flush() bool {
|
func (this *AckList) Flush() bool {
|
||||||
seg := &ACKSegment{
|
seg := &ACKSegment{
|
||||||
Conv: this.kcp.conv,
|
Conv: this.kcp.conv,
|
||||||
ReceivingNext: this.kcp.rcv_nxt,
|
ReceivingNext: this.kcp.rcv_nxt,
|
||||||
|
|
Loading…
Reference in New Issue