Home / Class/ ZipBombIncomingHandler Class — netty Architecture

ZipBombIncomingHandler Class — netty Architecture

Architecture documentation for the ZipBombIncomingHandler class in HttpContentDecompressorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  065dd300_499e_6894_9754_25466150e1c7["ZipBombIncomingHandler"]
  5bcb0483_87ec_e418_270b_d7f960c32109["HttpContentDecompressorTest.java"]
  065dd300_499e_6894_9754_25466150e1c7 -->|defined in| 5bcb0483_87ec_e418_270b_d7f960c32109
  2b835559_a88a_cf39_e7f9_216c45d3a41e["ZipBombIncomingHandler()"]
  065dd300_499e_6894_9754_25466150e1c7 -->|method| 2b835559_a88a_cf39_e7f9_216c45d3a41e
  b0d7a82f_c66f_3e0f_8055_3d339eec58a3["channelRead()"]
  065dd300_499e_6894_9754_25466150e1c7 -->|method| b0d7a82f_c66f_3e0f_8055_3d339eec58a3

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecompressorTest.java lines 152–172

    private static final class ZipBombIncomingHandler extends ChannelInboundHandlerAdapter {
        final int memoryLimit;
        long total;

        ZipBombIncomingHandler(int memoryLimit) {
            this.memoryLimit = memoryLimit;
        }

        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) {
            PooledByteBufAllocator allocator = (PooledByteBufAllocator) ctx.alloc();
            assertTrue(allocator.metric().usedHeapMemory() < memoryLimit);
            assertTrue(allocator.metric().usedDirectMemory() < memoryLimit);

            if (msg instanceof HttpContent) {
                HttpContent buf = (HttpContent) msg;
                total += buf.content().readableBytes();
                buf.release();
            }
        }
    }

Frequently Asked Questions

What is the ZipBombIncomingHandler class?
ZipBombIncomingHandler is a class in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecompressorTest.java.
Where is ZipBombIncomingHandler defined?
ZipBombIncomingHandler is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecompressorTest.java at line 152.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free