mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 14:29:42 +08:00
新增压缩功能-LZS算法
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package sessdata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bjdgyc/anylink/base"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -34,5 +36,23 @@ func TestConnSession(t *testing.T) {
|
||||
err = cSess.RateLimit(200, false)
|
||||
ast.Nil(err)
|
||||
ast.Equal(cSess.BandwidthDown.Load(), uint32(200))
|
||||
|
||||
var (
|
||||
cmpName string
|
||||
ok bool
|
||||
)
|
||||
base.Cfg.Compression = true
|
||||
|
||||
cmpName, ok = cSess.SetPickCmp("cstp", "oc-lz4,lzs")
|
||||
fmt.Println(cmpName, ok)
|
||||
ast.True(ok)
|
||||
ast.Equal(cmpName, "lzs")
|
||||
cmpName, ok = cSess.SetPickCmp("dtls", "lzs")
|
||||
ast.True(ok)
|
||||
ast.Equal(cmpName, "lzs")
|
||||
cmpName, ok = cSess.SetPickCmp("dtls", "test")
|
||||
ast.False(ok)
|
||||
ast.Equal(cmpName, "")
|
||||
|
||||
cSess.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user