From 09570db0915e83a92679e0648b48d86634b14ee4 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 7 Jun 2012 17:06:13 +0900 Subject: [PATCH] Fixed a bug where ChannelInitializer can trigger the same event twice --- .../src/main/java/io/netty/channel/ChannelInitializer.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelInitializer.java b/transport/src/main/java/io/netty/channel/ChannelInitializer.java index a0ff3cb8b0..0ec4da0a17 100644 --- a/transport/src/main/java/io/netty/channel/ChannelInitializer.java +++ b/transport/src/main/java/io/netty/channel/ChannelInitializer.java @@ -35,9 +35,7 @@ public abstract class ChannelInitializer extends ChannelState initChannel((C) ctx.channel()); ctx.pipeline().remove(this); removed = true; - // Note that we do not call ctx.fireChannelRegistered() because a user might have - // inserted a handler before the initializer using pipeline.addFirst(). - ctx.pipeline().fireChannelRegistered(); + ctx.fireChannelRegistered(); success = true; } catch (Throwable t) { logger.warn("Failed to initialize a channel. Closing: " + ctx.channel(), t);