Throw Exception when generating a 30,000+ byte packet
This commit is contained in:
@@ -36,6 +36,9 @@ public abstract class AppEngPacket
|
|||||||
|
|
||||||
public FMLProxyPacket getProxy()
|
public FMLProxyPacket getProxy()
|
||||||
{
|
{
|
||||||
|
if ( p.array().length > 30000 ) // 2k walking room :)
|
||||||
|
throw new IllegalArgumentException( "Sorry AE2 made a huge packet by accident!" );
|
||||||
|
|
||||||
return new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
|
return new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
|||||||
compressFrame = null;
|
compressFrame = null;
|
||||||
list = new LinkedList();
|
list = new LinkedList();
|
||||||
|
|
||||||
int originalBytes = stream.readableBytes();
|
// int originalBytes = stream.readableBytes();
|
||||||
|
|
||||||
GZIPInputStream gzReader = new GZIPInputStream( new InputStream() {
|
GZIPInputStream gzReader = new GZIPInputStream( new InputStream() {
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
|||||||
}
|
}
|
||||||
gzReader.close();
|
gzReader.close();
|
||||||
|
|
||||||
int uncompesssedBytes = uncompesssed.readableBytes();
|
// int uncompesssedBytes = uncompesssed.readableBytes();
|
||||||
// AELog.info( "Recv: " + originalBytes + " -> " + uncompesssedBytes );
|
// AELog.info( "Recv: " + originalBytes + " -> " + uncompesssedBytes );
|
||||||
|
|
||||||
while (uncompesssed.readableBytes() > 0)
|
while (uncompesssed.readableBytes() > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user