Don't append empty slices in the unfragmented path

Signed-off-by: Neil Twigg <neil@nats.io>
This commit is contained in:
Neil Twigg
2023-10-04 17:18:47 +01:00
parent 6b65452bc7
commit e20ca9043f

View File

@@ -1340,7 +1340,9 @@ func (c *client) wsCollapsePtoNB() (net.Buffers, int64) {
if mask { if mask {
wsMaskBuf(key, p) wsMaskBuf(key, p)
} }
bufs = append(bufs, h, p) if ol > 0 {
bufs = append(bufs, h, p)
}
csz = len(h) + ol csz = len(h) + ol
} }
// Add to pb the compressed data size (including headers), but // Add to pb the compressed data size (including headers), but