Alanxtl commented on code in PR #3620:
URL: https://github.com/apache/dubbo-go/pull/3620#discussion_r3747808800
##########
protocol/triple/client.go:
##########
@@ -284,6 +284,26 @@ func newClientManager(url *common.URL) (*clientManager,
error) {
}, nil
}
+func newHTTP3Transport(
+ tlsConfig *tls.Config,
+ http3Config *global.Http3Config,
+ keepAliveInterval time.Duration,
+ keepAliveTimeout time.Duration,
+) (http.RoundTripper, error) {
+ quicConfig, err := http3config.NewQUICConfigWithDefaults(http3Config,
&quic.Config{
+ KeepAlivePeriod: keepAliveInterval,
+ MaxIdleTimeout: keepAliveTimeout,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ return &http3.Transport{
+ TLSClientConfig: tlsConfig,
+ QUICConfig: quicConfig,
+ }, nil
+}
Review Comment:
这个函数也没有封装一下的必要吧
##########
protocol/triple/internal/http3config/http3_config.go:
##########
@@ -30,8 +30,18 @@ import (
"dubbo.apache.org/dubbo-go/v3/global"
)
-func newQUICConfig(http3Config *global.Http3Config) (*quic.Config, error) {
+// NewQUICConfig maps HTTP/3 transport configuration to quic-go configuration.
+func NewQUICConfig(http3Config *global.Http3Config) (*quic.Config, error) {
+ return NewQUICConfigWithDefaults(http3Config, nil)
+}
Review Comment:
这个函数为啥要包一层
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]