diff --git a/app/cmd/client.go b/app/cmd/client.go index e1ce48f..dbe554f 100644 --- a/app/cmd/client.go +++ b/app/cmd/client.go @@ -184,18 +184,19 @@ func (c *clientConfig) fillQUICConfig(hyConfig *client.Config) error { } func (c *clientConfig) fillBandwidthConfig(hyConfig *client.Config) error { - if c.Bandwidth.Up == "" || c.Bandwidth.Down == "" { - // New core now allows users to omit bandwidth values and use built-in congestion control - return nil - } + // New core now allows users to omit bandwidth values and use built-in congestion control var err error - hyConfig.BandwidthConfig.MaxTx, err = convBandwidth(c.Bandwidth.Up) - if err != nil { - return configError{Field: "bandwidth.up", Err: err} + if c.Bandwidth.Up != "" { + hyConfig.BandwidthConfig.MaxTx, err = convBandwidth(c.Bandwidth.Up) + if err != nil { + return configError{Field: "bandwidth.up", Err: err} + } } - hyConfig.BandwidthConfig.MaxRx, err = convBandwidth(c.Bandwidth.Down) - if err != nil { - return configError{Field: "bandwidth.down", Err: err} + if c.Bandwidth.Down != "" { + hyConfig.BandwidthConfig.MaxRx, err = convBandwidth(c.Bandwidth.Down) + if err != nil { + return configError{Field: "bandwidth.down", Err: err} + } } return nil } diff --git a/core/client/client.go b/core/client/client.go index 24c3be8..c3750c4 100644 --- a/core/client/client.go +++ b/core/client/client.go @@ -132,7 +132,7 @@ func (c *clientImpl) connect() error { conn.SetCongestionControl(bbr.NewBBRSender( bbr.DefaultClock{}, bbr.GetInitialPacketSize(conn.RemoteAddr()), - 32*common.InitMaxDatagramSize, + bbr.InitialCongestionWindow*common.InitMaxDatagramSize, bbr.DefaultBBRMaxCongestionWindow*common.InitMaxDatagramSize, )) } diff --git a/core/server/server.go b/core/server/server.go index 82e2168..5781851 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -135,7 +135,7 @@ func (h *h3sHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.conn.SetCongestionControl(bbr.NewBBRSender( bbr.DefaultClock{}, bbr.GetInitialPacketSize(h.conn.RemoteAddr()), - 32*common.InitMaxDatagramSize, + bbr.InitialCongestionWindow*common.InitMaxDatagramSize, bbr.DefaultBBRMaxCongestionWindow*common.InitMaxDatagramSize, )) }