diff --git a/go.mod b/go.mod index fdca9ecb9..5df7cab57 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 61f6b082c..c2f2852ed 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/github.com/xtaci/kcp-go/v5/fec.go b/vendor/github.com/xtaci/kcp-go/v5/fec.go index 88f5a9c4b..27dd66e2a 100644 --- a/vendor/github.com/xtaci/kcp-go/v5/fec.go +++ b/vendor/github.com/xtaci/kcp-go/v5/fec.go @@ -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 diff --git a/vendor/modules.txt b/vendor/modules.txt index 1a80b3539..65887fd77 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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