Skip to content

Commit

Permalink
refactor(#26): change compress/flate to github.com/klauspost/compress…
Browse files Browse the repository at this point in the history
…/flate
  • Loading branch information
savsgio committed Nov 24, 2022
1 parent fbacd09 commit c9cb05f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
package websocket

import (
"compress/flate"
"errors"
"io"
"strings"
"sync"

"github.com/klauspost/compress/flate"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ func (c *Conn) EnableWriteCompression(enable bool) {

// SetCompressionLevel sets the flate compression level for subsequent text and
// binary messages. This function is a noop if compression was not negotiated
// with the peer. See the compress/flate package for a description of
// with the peer. See the github.com/klauspost/compress/flate package for a description of
// compression levels.
func (c *Conn) SetCompressionLevel(level int) error {
if c == nil {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/fasthttp/websocket
go 1.16

require (
github.com/klauspost/compress v1.15.12
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d
github.com/valyala/fasthttp v1.42.0
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/compress v1.15.12 h1:YClS/PImqYbn+UILDnqxQCZ3RehC9N318SU3kElDUEM=
github.com/klauspost/compress v1.15.12/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d h1:Q+gqLBOPkFGHyCJxXMRqtUgUbTjI8/Ze8vu8GGyNFwo=
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
Expand Down
3 changes: 2 additions & 1 deletion prepared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ package websocket

import (
"bytes"
"compress/flate"
"math/rand"
"testing"

"github.com/klauspost/compress/flate"
)

var preparedMessageTests = []struct {
Expand Down

0 comments on commit c9cb05f

Please sign in to comment.