mirror of
https://github.com/containous/traefik.git
synced 2024-12-22 13:34:03 +03:00
Rework condition to not log on timeout
This commit is contained in:
parent
0be01cc067
commit
e62f8af23b
@ -28,7 +28,7 @@ func isPostgres(br *bufio.Reader) (bool, error) {
|
|||||||
peeked, err := br.Peek(i)
|
peeked, err := br.Peek(i)
|
||||||
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.Error().Err(err).Msg("Error while Peeking first byte")
|
log.Error().Err(err).Msg("Error while Peeking first byte")
|
||||||
}
|
}
|
||||||
return false, err
|
return false, err
|
||||||
|
@ -363,7 +363,7 @@ func clientHelloInfo(br *bufio.Reader) (*clientHello, error) {
|
|||||||
hdr, err := br.Peek(1)
|
hdr, err := br.Peek(1)
|
||||||
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.Error().Err(err).Msg("Error while Peeking first byte")
|
log.Error().Err(err).Msg("Error while Peeking first byte")
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user