diff --git a/CHANGELOG.md b/CHANGELOG.md index 420e6f2..1b9642e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,7 @@ # Change Log + +## v1.0.1 (2024-04-15) + +### Bug Fixes + +- tcpconn: check negative idle timeout to prevent unexpected behaviour (#17) diff --git a/tcpconn.go b/tcpconn.go index e8605b8..d9318b4 100644 --- a/tcpconn.go +++ b/tcpconn.go @@ -502,7 +502,7 @@ func (tc *tcpconn) SetIdleTimeout(d time.Duration) error { if !tc.IsActive() { return ErrConnClosed } - if d == 0 { + if d <= 0 { return nil } if tc.idleTimer != nil {