Remove noisy printf in NextReader()

This commit is contained in:
Brendan Creane 2023-11-29 13:16:16 -08:00 committed by Alex Vulaj
parent 01b0aaed92
commit dcea2f088c
2 changed files with 3 additions and 11 deletions

View File

@ -8,7 +8,6 @@ import (
"compress/flate"
"errors"
"io"
"log"
"strings"
"sync"
)
@ -135,9 +134,7 @@ func (r *flateReadWrapper) Read(p []byte) (int, error) {
// Preemptively place the reader back in the pool. This helps with
// scenarios where the application does not call NextReader() soon after
// this final read.
if err := r.Close(); err != nil {
log.Printf("websocket: flateReadWrapper.Close() returned error: %v", err)
}
_ = r.Close()
}
return n, err
}

View File

@ -10,7 +10,6 @@ import (
"encoding/binary"
"errors"
"io"
"log"
"net"
"strconv"
"strings"
@ -490,9 +489,7 @@ func (c *Conn) beginMessage(mw *messageWriter, messageType int) error {
// probably better to return an error in this situation, but we cannot
// change this without breaking existing applications.
if c.writer != nil {
if err := c.writer.Close(); err != nil {
log.Printf("websocket: discarding writer close error: %v", err)
}
_ = c.writer.Close()
c.writer = nil
}
@ -1021,9 +1018,7 @@ func (c *Conn) handleProtocolError(message string) error {
func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
// Close previous reader, only relevant for decompression.
if c.reader != nil {
if err := c.reader.Close(); err != nil {
log.Printf("websocket: discarding reader close error: %v", err)
}
_ = c.reader.Close()
c.reader = nil
}