cshannon commented on a change in pull request #756:
URL: https://github.com/apache/activemq/pull/756#discussion_r800208475
##########
File path:
activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOTransport.java
##########
@@ -139,8 +139,10 @@ protected void serviceRead() {
nextFrameSize = inputBuffer.getInt() + 4;
if (wireFormat instanceof OpenWireFormat) {
- long maxFrameSize =
((OpenWireFormat)wireFormat).getMaxFrameSize();
- if (nextFrameSize > maxFrameSize) {
+ OpenWireFormat openWireFormat =
(OpenWireFormat)wireFormat;
+ long maxFrameSize = openWireFormat.getMaxFrameSize();
+
+ if (openWireFormat.isMaxFrameSizeEnabled() &&
nextFrameSize > maxFrameSize) {
throw new IOException("Frame size of " +
(nextFrameSize / (1024 * 1024)) + " MB larger than max allowed " +
(maxFrameSize / (1024 * 1024)) + " MB");
Review comment:
I'd use the createFrameSizeException() here
--
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]