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:
parent
1cce998bb0
commit
3440eadb38
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user