RainYuY commented on code in PR #15616:
URL: https://github.com/apache/dubbo/pull/15616#discussion_r2269388601


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/ReflectionPackableMethod.java:
##########
@@ -86,23 +87,51 @@ public ReflectionPackableMethod(
         }
 
         boolean singleArgument = method.getRpcType() != 
MethodDescriptor.RpcType.UNARY;
-        this.needWrapper = needWrap(method, actualRequestTypes, 
actualResponseType);
+
+        // Check protocol requirements for wrapper - this is mainly for legacy 
compatibility
+        boolean protocolNeedsWrapper = needWrap(method, actualRequestTypes, 
actualResponseType);
+        boolean serializationSupportsZeroCopy = 
isZeroCopyCapable(serializeName, url);
+
+        // Zero-copy should only be used when protocol allows it AND 
serialization supports it
+        // If protocol needs wrapper OR serialization doesn't support 
zero-copy, use wrapper mode

Review Comment:
   Why not use and?



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