From 61e850a36a8b99b8cffe21fbb33688f3ea4fd8e4 Mon Sep 17 00:00:00 2001 From: lxzan Date: Sat, 27 Jan 2024 08:30:13 +0800 Subject: [PATCH] upgrade compress package --- go.mod | 2 +- go.sum | 2 ++ option_test.go | 13 ++++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index c8c941a6..09669ed5 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/dolthub/maphash v0.1.0 - github.com/klauspost/compress v1.17.5-0.20240119100516-32312d57f3c7 + github.com/klauspost/compress v1.17.5 github.com/stretchr/testify v1.8.4 ) diff --git a/go.sum b/go.sum index bf084870..c46b9ed5 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/dolthub/maphash v0.1.0 h1:bsQ7JsF4FkkWyrP3oCnFJgrCUAFbFf3kOl4L/QxPDyQ github.com/dolthub/maphash v0.1.0/go.mod h1:gkg4Ch4CdCDu5h6PMriVLawB7koZ+5ijb9puGMV50a4= github.com/klauspost/compress v1.17.5-0.20240119100516-32312d57f3c7 h1:cBVUjnVhEblq1CXwboJtC3F1lQYutr/4sVsnhLUAgiE= github.com/klauspost/compress v1.17.5-0.20240119100516-32312d57f3c7/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= +github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= diff --git a/option_test.go b/option_test.go index 53fe630e..f13274d1 100644 --- a/option_test.go +++ b/option_test.go @@ -177,16 +177,23 @@ func TestCompressClientOption(t *testing.T) { t.Run("", func(t *testing.T) { var option = &ClientOption{ PermessageDeflate: PermessageDeflate{ - Enabled: true, - Level: flate.BestCompression, - Threshold: 1024, + Enabled: true, + ServerContextTakeover: true, + ClientContextTakeover: true, + Level: flate.BestCompression, + Threshold: 1024, }, } initClientOption(option) + as.Equal(true, option.PermessageDeflate.Enabled) as.Equal(flate.BestCompression, option.PermessageDeflate.Level) as.Equal(1024, option.PermessageDeflate.Threshold) validateClientOption(as, option) + + var cfg = option.getConfig() + as.Nil(cfg.cswPool) + as.Nil(cfg.dswPool) }) }