I've a very simple pipeline configuration, with one InboundHandler.
If I set a breakpoint to the channelRead0 method, the debugger will stop twice and I've no idea why. My first idea was, it has something to do with HttpReponse and HttpContent but in both cases the object (second parameter) is of type FullHttpRequest. Where is the bug? I'm using Netty 4.0.13.
-wolfgang
pipeline.addLast("codec-http", new HttpServerCodec(
maxInitialLineLength, maxHeaderSize,
maxChunkSize));
pipeline.addLast("aggregator",new HttpObjectAggregator(maxContentLength));
pipeline.addLast("decompressor",new HttpContentDecompressor());
pipeline.addLast("compressor", new HttpContentCompressor());
pipeline.addLast("handler", new HttpHandler());
public class HttpHandler extends SimpleChannelInboundHandler<Object> {
@Override
protected void channelRead0(
ChannelHandlerContext ctx, Object object)
throws Exception {
if (object instanceof FullHttpRequest) {
FullHttpResponse resp = handleHttpRequest((FullHttpRequest)object);
if (resp != null) {
sendHttpResponse(ctx, (FullHttpRequest)object, resp);
} else {
ctx.fireChannelRead(object);
}
} else {
ctx.fireChannelRead(object);
}
}
}