Use FrameDecoder.setMaxCumulationBufferComponents(Integer.MAX_VALUE) for Decoders that needs to handle big frames. See #424

This commit is contained in:
Norman Maurer 2012-06-29 13:42:43 +02:00
parent 28a1992bf4
commit a746b5d3fe
4 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,7 @@ public class CompatibleMarshallingDecoder extends ReplayingDecoder<VoidEnum> {
public CompatibleMarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize) {
this.provider = provider;
this.maxObjectSize = maxObjectSize;
setMaxCumulationBufferComponents(Integer.MAX_VALUE);
}
@Override

View File

@ -57,6 +57,7 @@ public class MarshallingDecoder extends LengthFieldBasedFrameDecoder {
public MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize) {
super(maxObjectSize, 0, 4, 0, 4);
this.provider = provider;
setMaxCumulationBufferComponents(Integer.MAX_VALUE);
}

View File

@ -61,6 +61,7 @@ public class CompatibleObjectDecoder extends ReplayingDecoder<CompatibleObjectDe
*/
public CompatibleObjectDecoder() {
super(CompatibleObjectDecoderState.READ_HEADER);
setMaxCumulationBufferComponents(Integer.MAX_VALUE);
}
/**

View File

@ -93,6 +93,7 @@ public class ObjectDecoder extends LengthFieldBasedFrameDecoder {
public ObjectDecoder(int maxObjectSize, ClassResolver classResolver) {
super(maxObjectSize, 0, 4, 0, 4);
this.classResolver = classResolver;
setMaxCumulationBufferComponents(Integer.MAX_VALUE);
}