If parentHandler is specified, ServerBootstrap should not use StaticChannelPipeline because the parentHandler might want to manipulate the pipeline

This commit is contained in:
Trustin Lee 2009-12-18 06:22:08 +00:00
parent 64f0a931a4
commit eb575430c2

View File

@ -269,7 +269,9 @@ public class ServerBootstrap extends Bootstrap {
ChannelHandler binder = new Binder(localAddress, futureQueue);
ChannelHandler parentHandler = getParentHandler();
if (parentHandler != null) {
bossPipeline = new StaticChannelPipeline(binder, parentHandler);
bossPipeline = pipeline();
bossPipeline.addLast("binder", binder);
bossPipeline.addLast("userHandler", parentHandler);
} else {
bossPipeline = new StaticChannelPipeline(binder);
}