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

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1389817 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-09-25 11:37:59 +00:00
parent 5aed30d5df
commit c50c1f5dad
3 changed files with 8 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public final class OpenWireFormat implements WireFormat {
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;

View File

@ -119,6 +119,11 @@ public class NumberRangesWhileMarshallingTest extends TestCase {
}
public void testDefaultMaxFrameSizeUnlimited() {
OpenWireFormat wf = new OpenWireFormat();
assertEquals(Long.MAX_VALUE, wf.getMaxFrameSize());
}
protected void setUp() throws Exception {
super.setUp();
openWireformat = createOpenWireFormat();

View File

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