marsevilspirit commented on code in PR #2900:
URL: https://github.com/apache/dubbo-go/pull/2900#discussion_r2114169946


##########
protocol/triple/server.go:
##########
@@ -174,19 +175,46 @@ func (s *Server) RefreshService(invoker base.Invoker, 
info *common.ServiceInfo)
 }
 
 func getHanOpts(url *common.URL) (hanOpts []tri.HandlerOption) {
+       var tripleConf *global.TripleConfig
+
+       tripleConfRaw, ok := url.GetAttribute(constant.TripleConfigKey)
+       if ok {
+               tripleConf = tripleConfRaw.(*global.TripleConfig)
+       }
+
+       // Deprecated:use TripleConfig
+       // TODO: remove MaxServerSendMsgSize and MaxServerRecvMsgSize when 
version 4.0.0
        var err error
        maxServerRecvMsgSize := constant.DefaultMaxServerRecvMsgSize
        if recvMsgSize, convertErr := 
humanize.ParseBytes(url.GetParam(constant.MaxServerRecvMsgSize, "")); 
convertErr == nil && recvMsgSize != 0 {
                maxServerRecvMsgSize = int(recvMsgSize)
        }
        hanOpts = append(hanOpts, tri.WithReadMaxBytes(maxServerRecvMsgSize))
 
+       if tripleConf != nil && tripleConf.MaxServerRecvMsgSize != "" {
+               logger.Warnf("MaxServerRecvMsgSize: %v", 
tripleConf.MaxServerRecvMsgSize)
+               if recvMsgSize, convertErr := 
humanize.ParseBytes(tripleConf.MaxServerRecvMsgSize); convertErr == nil && 
recvMsgSize != 0 {
+                       maxServerRecvMsgSize = int(recvMsgSize)
+               }
+               hanOpts = append(hanOpts, 
tri.WithReadMaxBytes(maxServerRecvMsgSize))
+       }
+
+       // Deprecated:use TripleConfig

Review Comment:
   fixed.



-- 
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]

Reply via email to