Skip to content

Commit 37aa2bb

Browse files
TheM1984pires
authored andcommitted
with commit 7f1f93d the default timeout was changed from 200ms to 10s however the Go Documentation still shows the old default
1 parent bac82fd commit 37aa2bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

protocol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var (
2828
// If the connection is using the protocol, the RemoteAddr() will return
2929
// the correct client address. ReadHeaderTimeout will be applied to all
3030
// connections in order to prevent blocking operations. If no ReadHeaderTimeout
31-
// is set, a default of 200ms will be used. This can be disabled by setting the
31+
// is set, a default of 10s will be used. This can be disabled by setting the
3232
// timeout to < 0.
3333
//
3434
// Only one of Policy or ConnPolicy should be provided. If both are provided then

protocol_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ func TestReadHeaderTimeoutIsReset(t *testing.T) {
296296
}
297297

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

0 commit comments

Comments
 (0)