@@ -49,7 +49,6 @@ public class MinecraftCompressDecoder extends MessageToMessageDecoder<ByteBuf> {
4949 ? HARD_MAXIMUM_UNCOMPRESSED_SIZE : SERVERBOUND_MAXIMUM_UNCOMPRESSED_SIZE ;
5050
5151 private static final boolean SKIP_COMPRESSION_VALIDATION = Boolean .getBoolean ("velocity.skip-uncompressed-packet-size-validation" );
52- private static final double MAX_COMPRESSION_RATIO = Double .parseDouble (System .getProperty ("velocity.max-compression-ratio" , "64" ));
5352
5453 private final ProtocolUtils .Direction direction ;
5554 private int threshold ;
@@ -88,7 +87,6 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
8887 out .add (in .retain ());
8988 return ;
9089 }
91- int length = in .readableBytes ();
9290
9391 checkFrame (claimedUncompressedSize >= threshold , "Uncompressed size %s is less than"
9492 + " threshold %s" , claimedUncompressedSize , threshold );
@@ -100,10 +98,6 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
10098 checkFrame (claimedUncompressedSize <= SERVERBOUND_UNCOMPRESSED_CAP ,
10199 "Uncompressed size %s exceeds hard threshold of %s" , claimedUncompressedSize ,
102100 SERVERBOUND_UNCOMPRESSED_CAP );
103- double maxCompressedAllowed = length * MAX_COMPRESSION_RATIO ;
104- checkFrame (claimedUncompressedSize <= maxCompressedAllowed ,
105- "Uncompressed size %s exceeds ratio threshold of %s for compressed sized %s" , claimedUncompressedSize ,
106- maxCompressedAllowed , length );
107101 }
108102 ByteBuf compatibleIn = ensureCompatible (ctx .alloc (), compressor , in );
109103 ByteBuf uncompressed = preferredBuffer (ctx .alloc (), compressor , claimedUncompressedSize );
0 commit comments