upd deps of kcp-go to @v5.6.5

This commit is contained in:
xtaci
2023-10-12 23:29:36 +08:00
parent 143991124c
commit 0440abbc91
4 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/pkg/errors v0.9.1
github.com/urfave/cli v1.22.14
github.com/xtaci/kcp-go/v5 v5.6.3
github.com/xtaci/kcp-go/v5 v5.6.5
github.com/xtaci/smux v1.5.24
github.com/xtaci/tcpraw v1.2.25
golang.org/x/crypto v0.14.0
+2
View File
@@ -61,6 +61,8 @@ github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/xtaci/kcp-go/v5 v5.6.3 h1:yd59SKXdJ0PBxeMBy3apalxFCEmBLGgQmL6nP46tU0g=
github.com/xtaci/kcp-go/v5 v5.6.3/go.mod h1:uIuw2KEg3FcmEdS4PeXHaGty9Ui7NYb1WKIrSDwpMg4=
github.com/xtaci/kcp-go/v5 v5.6.5 h1:oxGZNobj3OddrLzwdJYnR/waNgwrL98u02u0DWNHE3k=
github.com/xtaci/kcp-go/v5 v5.6.5/go.mod h1:Qy3Zf2tWTdFdEs0E8JvhrX+39r5UDZoYac8anvud7/Q=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE=
github.com/xtaci/smux v1.5.24 h1:77emW9dtnOxxOQ5ltR+8BbsX1kzcOxQ5gB+aaV9hXOY=
+11 -5
View File
@@ -45,7 +45,8 @@ type fecDecoder struct {
codec reedsolomon.Encoder
// auto tune fec parameter
autoTune autoTune
autoTune autoTune
shouldTune bool
}
func newFECDecoder(dataShards, parityShards int) *fecDecoder {
@@ -78,18 +79,17 @@ func (dec *fecDecoder) decode(in fecPacket) (recovered [][]byte) {
}
// check if FEC parameters is out of sync
var shouldTune bool
if int(in.seqid())%dec.shardSize < dec.dataShards {
if in.flag() != typeData { // expect typeData
shouldTune = true
dec.shouldTune = true
}
} else {
if in.flag() != typeParity {
shouldTune = true
dec.shouldTune = true
}
}
if shouldTune {
if dec.shouldTune {
autoDS := dec.autoTune.FindPeriod(true)
autoPS := dec.autoTune.FindPeriod(false)
@@ -108,11 +108,17 @@ func (dec *fecDecoder) decode(in fecPacket) (recovered [][]byte) {
dec.codec = codec
dec.decodeCache = make([][]byte, dec.shardSize)
dec.flagCache = make([]bool, dec.shardSize)
dec.shouldTune = false
//log.Println("autotune to :", dec.dataShards, dec.parityShards)
}
}
}
// parameters in tuning
if dec.shouldTune {
return nil
}
// insertion
n := len(dec.rx) - 1
insertIdx := 0
+1 -1
View File
@@ -35,7 +35,7 @@ github.com/tjfoc/gmsm/sm4
# github.com/urfave/cli v1.22.14
## explicit; go 1.11
github.com/urfave/cli
# github.com/xtaci/kcp-go/v5 v5.6.3
# github.com/xtaci/kcp-go/v5 v5.6.5
## explicit; go 1.21
github.com/xtaci/kcp-go/v5
# github.com/xtaci/smux v1.5.24