Skip to content

Commit

Permalink
with commit 7f1f93d the default timeout was changed from 200ms to 10s…
Browse files Browse the repository at this point in the history
… however the Go Documentation still shows the old default
  • Loading branch information
TheM1984 committed Jan 7, 2025
1 parent bac82fd commit 58fc90d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
// If the connection is using the protocol, the RemoteAddr() will return
// the correct client address. ReadHeaderTimeout will be applied to all
// connections in order to prevent blocking operations. If no ReadHeaderTimeout
// is set, a default of 200ms will be used. This can be disabled by setting the
// is set, a default of 10s will be used. This can be disabled by setting the
// timeout to < 0.
//
// Only one of Policy or ConnPolicy should be provided. If both are provided then
Expand Down
4 changes: 2 additions & 2 deletions protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ func TestReadHeaderTimeoutIsReset(t *testing.T) {
}

// TestReadHeaderTimeoutIsEmpty ensures the default is set if it is empty.
// Because the default is 200ms and we wait longer than that to send a message,
// we expect the actual address and port to be returned,
// The default is 10s, but we delay sending a message, so use 200ms in this test.
// We expect the actual address and port to be returned,
// rather than the ProxyHeader we defined.
func TestReadHeaderTimeoutIsEmpty(t *testing.T) {
DefaultReadHeaderTimeout = 200 * time.Millisecond
Expand Down

0 comments on commit 58fc90d

Please sign in to comment.