Skip to content

Commit

Permalink
tcpconn: check negative idle timeout to prevent unexpected behaviour (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
WineChord authored Apr 15, 2024
1 parent ed8bb2a commit 5ab0d18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# Change Log

## v1.0.1 (2024-04-15)

### Bug Fixes

- tcpconn: check negative idle timeout to prevent unexpected behaviour (#17)
2 changes: 1 addition & 1 deletion tcpconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5ab0d18

Please sign in to comment.