From 6bba3c19dd0feffc97c25d4f01d9f4d8202e8d9e Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 3 Dec 2013 13:56:43 +0100 Subject: [PATCH] [#2033] Correctly handle adding of IdleStateHandler after Channel was already active and registered --- .../main/java/io/netty/handler/timeout/IdleStateHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java b/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java index 2816860382..a50ffebedc 100644 --- a/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java +++ b/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java @@ -207,7 +207,7 @@ public class IdleStateHandler extends ChannelHandlerAdapter { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { - if (ctx.channel().isActive() & ctx.channel().isRegistered()) { + if (ctx.channel().isActive() && ctx.channel().isRegistered()) { // channelActvie() event has been fired already, which means this.channelActive() will // not be invoked. We have to initialize here instead. initialize(ctx);