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
14e1d0f9f7
commit
e3980a6487
@ -314,12 +314,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;
|
||||
}
|
||||
}
|
||||
@ -348,25 +350,6 @@ public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http
|
||||
}
|
||||
}
|
||||
|
||||
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