activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1389817 - in /activemq/trunk: activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java assembly/src/release/conf/activemq.xml
Date Tue, 25 Sep 2012 11:37:59 GMT
Author: gtully
Date: Tue Sep 25 11:37:59 2012
New Revision: 1389817

URL: http://svn.apache.org/viewvc?rev=1389817&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-4076 https://issues.apache.org/jira/browse/AMQ-498
- default to unlimited maxFrameSize - explicit limits in the xml config with DOS comment

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java
    activemq/trunk/assembly/src/release/conf/activemq.xml

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=1389817&r1=1389816&r2=1389817&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
Tue Sep 25 11:37:59 2012
@@ -40,7 +40,7 @@ public final class OpenWireFormat implem
 
     public static final int DEFAULT_VERSION = CommandTypes.PROTOCOL_STORE_VERSION;
     public static final int DEFAULT_WIRE_VERSION = CommandTypes.PROTOCOL_VERSION;
-    public static final int DEFAULT_MAX_FRAME_SIZE = 100 * 1024 * 1024; //100 MB
+    public static final long DEFAULT_MAX_FRAME_SIZE = Long.MAX_VALUE;
 
     static final byte NULL_TYPE = CommandTypes.NULL;
     private static final int MARSHAL_CACHE_SIZE = Short.MAX_VALUE / 2;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java?rev=1389817&r1=1389816&r2=1389817&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java
Tue Sep 25 11:37:59 2012
@@ -119,6 +119,11 @@ public class NumberRangesWhileMarshallin
 
     }
 
+    public void testDefaultMaxFrameSizeUnlimited() {
+        OpenWireFormat wf = new OpenWireFormat();
+        assertEquals(Long.MAX_VALUE, wf.getMaxFrameSize());
+    }
+
     protected void setUp() throws Exception {
         super.setUp();
         openWireformat = createOpenWireFormat();

Modified: activemq/trunk/assembly/src/release/conf/activemq.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/conf/activemq.xml?rev=1389817&r1=1389816&r2=1389817&view=diff
==============================================================================
--- activemq/trunk/assembly/src/release/conf/activemq.xml (original)
+++ activemq/trunk/assembly/src/release/conf/activemq.xml Tue Sep 25 11:37:59 2012
@@ -141,7 +141,8 @@
             http://activemq.apache.org/configuring-transports.html
         -->
         <transportConnectors>
-            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
+            <!-- DOS protection, limit concurrent connections to 1000 and frame size to
100MB -->
+            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616??maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>
         </transportConnectors>
 
     </broker>



Mime
View raw message