This commit is contained in:
Justin Bertram 2020-06-24 13:33:30 -05:00
commit f848feab66
1 changed files with 10 additions and 1 deletions

View File

@ -101,7 +101,7 @@ public class ProtocolHandler {
private final boolean httpEnabled; private final boolean httpEnabled;
private ScheduledFuture timeoutFuture; private ScheduledFuture<?> timeoutFuture;
private int handshakeTimeout; private int handshakeTimeout;
@ -122,6 +122,15 @@ public class ProtocolHandler {
} }
} }
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
if (handshakeTimeout > 0 && timeoutFuture != null) {
timeoutFuture.cancel(true);
timeoutFuture = null;
}
}
@Override @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof FullHttpRequest) { if (msg instanceof FullHttpRequest) {