Http2ConnectionHandler should propagate channelActive and channelInactive events.

Motivation:

The Http2ConnectionHandler incorrectly doesn't propagate channelActive and channelInactive events and thus breaks the pipeline
for other ChannelHandler.

Modification:

- Add calls to super.channelActive() and super.channelInactive().
- Remove unused methods.

Result:

- Http2ConnectionHandler can be used with other ChannelHandlers.
This commit is contained in:
Jakob Buchgraber 2015-04-28 16:27:54 -07:00 committed by Scott Mitchell
parent 1cce998bb0
commit 3440eadb38

View File

@ -317,12 +317,14 @@ public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http
byteDecoder = new PrefaceDecoder(ctx);
}
byteDecoder.channelActive(ctx);
super.channelActive(ctx);
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
if (byteDecoder != null) {
byteDecoder.channelInactive(ctx);
super.channelInactive(ctx);
byteDecoder = null;
}
}
@ -367,26 +369,6 @@ public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http
}
}
@Override
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
ctx.deregister(promise);
}
@Override
public void read(ChannelHandlerContext ctx) throws Exception {
ctx.read();
}
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
ctx.write(msg, promise);
}
@Override
public void flush(ChannelHandlerContext ctx) throws Exception {
ctx.flush();
}
/**
* Handles {@link Http2Exception} objects that were thrown from other handlers. Ignores all other exceptions.
*/