You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import"github.com/gofiber/contrib/websocket"typeWSConnection= websocket.Connfunc (r*Router) WSHandler(c*WSConnection) {
id:=strings.Clone(c.RemoteAddr().String())
c.EnableWriteCompression(true)
c.SetCompressionLevel(flate.BestSpeed+1)
deferc.Close()
r.connections.Set(id, c)
// Publisher spawns a separate goroutine that receives messages from a channel,// then on each message in the goroutine the callback is calledpub:=r.setupPublisher(id, func(headerBytes, msg []byte) bool {
returnr.writeMessage(c, msg, id)
})
...// Read from the connection in the goroutine
}
Bug Description
I got the segfault, when I turned on a compression:
How to Reproduce
Steps to reproduce the behavior:
Turn on the compression and after several hours(if you actively use the server) you will get a segfault
Expected Behavior
I expect that compression should work fine without segfaults
Contrib package Version
contrib/websocket v1.3.0
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: