From cb6db58fc127ac4ae5173faee85e2d5cf281b4c3 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 18 Jan 2022 09:23:56 +0400 Subject: [PATCH] use a uint64 in the AllowConnectionWindowIncrease callback --- config_test.go | 2 +- interface.go | 2 +- session.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config_test.go b/config_test.go index 4e815cbec..a8574f8d4 100644 --- a/config_test.go +++ b/config_test.go @@ -103,7 +103,7 @@ var _ = Describe("Config", func() { var calledAcceptToken, calledAllowConnectionWindowIncrease bool c1 := &Config{ AcceptToken: func(_ net.Addr, _ *Token) bool { calledAcceptToken = true; return true }, - AllowConnectionWindowIncrease: func(Session, int) bool { calledAllowConnectionWindowIncrease = true; return true }, + AllowConnectionWindowIncrease: func(Session, uint64) bool { calledAllowConnectionWindowIncrease = true; return true }, } c2 := c1.Clone() c2.AcceptToken(&net.UDPAddr{}, &Token{}) diff --git a/interface.go b/interface.go index fa53d7470..af846dc22 100644 --- a/interface.go +++ b/interface.go @@ -270,7 +270,7 @@ type Config struct { // to increase the connection flow control window. // If set, the caller can prevent an increase of the window. Typically, it would do so to // limit the memory usage. - AllowConnectionWindowIncrease func(sess Session, delta int) bool + AllowConnectionWindowIncrease func(sess Session, delta uint64) bool // MaxIncomingStreams is the maximum number of concurrent bidirectional streams that a peer is allowed to open. // Values above 2^60 are invalid. // If not set, it will default to 100. diff --git a/session.go b/session.go index 2c8b23696..2568acfa4 100644 --- a/session.go +++ b/session.go @@ -510,7 +510,7 @@ func (s *session) preSetup() { if s.config.AllowConnectionWindowIncrease == nil { return true } - return s.config.AllowConnectionWindowIncrease(s, int(size)) + return s.config.AllowConnectionWindowIncrease(s, uint64(size)) }, s.rttStats, s.logger,