Change level of peeking first byte error log to DEBUG

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Romain 2024-11-08 14:28:08 +01:00 committed by GitHub
parent 2096fd7081
commit a79cdd1dfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -350,7 +350,7 @@ func clientHelloInfo(br *bufio.Reader) (*clientHello, error) {
if err != nil { if err != nil {
var opErr *net.OpError var opErr *net.OpError
if !errors.Is(err, io.EOF) && (!errors.As(err, &opErr) || !opErr.Timeout()) { if !errors.Is(err, io.EOF) && (!errors.As(err, &opErr) || !opErr.Timeout()) {
log.WithoutContext().Errorf("Error while Peeking first byte: %s", err) log.WithoutContext().Debugf("Error while peeking first byte: %s", err)
} }
return nil, err return nil, err
} }
@ -376,7 +376,7 @@ func clientHelloInfo(br *bufio.Reader) (*clientHello, error) {
const recordHeaderLen = 5 const recordHeaderLen = 5
hdr, err = br.Peek(recordHeaderLen) hdr, err = br.Peek(recordHeaderLen)
if err != nil { if err != nil {
log.Errorf("Error while Peeking hello: %s", err) log.WithoutContext().Errorf("Error while peeking client hello headers: %s", err)
return &clientHello{ return &clientHello{
peeked: getPeeked(br), peeked: getPeeked(br),
}, nil }, nil
@ -390,7 +390,7 @@ func clientHelloInfo(br *bufio.Reader) (*clientHello, error) {
helloBytes, err := br.Peek(recordHeaderLen + recLen) helloBytes, err := br.Peek(recordHeaderLen + recLen)
if err != nil { if err != nil {
log.Errorf("Error while Hello: %s", err) log.WithoutContext().Errorf("Error while peeking client hello bytes: %s", err)
return &clientHello{ return &clientHello{
isTLS: true, isTLS: true,
peeked: getPeeked(br), peeked: getPeeked(br),
@ -419,7 +419,7 @@ func clientHelloInfo(br *bufio.Reader) (*clientHello, error) {
func getPeeked(br *bufio.Reader) string { func getPeeked(br *bufio.Reader) string {
peeked, err := br.Peek(br.Buffered()) peeked, err := br.Peek(br.Buffered())
if err != nil { if err != nil {
log.Errorf("Could not get anything: %s", err) log.WithoutContext().Errorf("Error while peeking bytes: %s", err)
return "" return ""
} }
return string(peeked) return string(peeked)