public abstract class io.netty.handler.ssl.ApplicationProtocolNegotiationHandler extends io.netty.channel.ChannelInboundHandlerAdapter
{
private static final io.netty.util.internal.logging.InternalLogger logger;
private final java.lang.String fallbackProtocol;
private final io.netty.util.internal.RecyclableArrayList bufferedMessages;
private io.netty.channel.ChannelHandlerContext ctx;
private boolean sslHandlerChecked;
protected void <init>(java.lang.String)
{
io.netty.util.internal.RecyclableArrayList v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
java.lang.Object v;
java.lang.String v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: java.lang.String;
specialinvoke v.<io.netty.channel.ChannelInboundHandlerAdapter: void <init>()>();
v = staticinvoke <io.netty.util.internal.RecyclableArrayList: io.netty.util.internal.RecyclableArrayList newInstance()>();
v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages> = v;
v = staticinvoke <io.netty.util.internal.ObjectUtil: java.lang.Object checkNotNull(java.lang.Object,java.lang.String)>(v, "fallbackProtocol");
v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: java.lang.String fallbackProtocol> = v;
return;
}
public void handlerAdded(io.netty.channel.ChannelHandlerContext) throws java.lang.Exception
{
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
io.netty.channel.ChannelHandlerContext v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.channel.ChannelHandlerContext ctx> = v;
specialinvoke v.<io.netty.channel.ChannelInboundHandlerAdapter: void handlerAdded(io.netty.channel.ChannelHandlerContext)>(v);
return;
}
public void handlerRemoved(io.netty.channel.ChannelHandlerContext) throws java.lang.Exception
{
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
io.netty.channel.ChannelHandlerContext v;
io.netty.util.internal.RecyclableArrayList v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void fireBufferedMessages()>();
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: boolean recycle()>();
specialinvoke v.<io.netty.channel.ChannelInboundHandlerAdapter: void handlerRemoved(io.netty.channel.ChannelHandlerContext)>(v);
return;
}
public void channelRead(io.netty.channel.ChannelHandlerContext, java.lang.Object) throws java.lang.Exception
{
io.netty.channel.ChannelHandlerContext v;
io.netty.util.internal.RecyclableArrayList v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
io.netty.channel.ChannelHandler v;
java.lang.Object v;
io.netty.channel.ChannelPipeline v;
boolean v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v := @parameter: java.lang.Object;
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: boolean add(java.lang.Object)>(v);
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: boolean sslHandlerChecked>;
if v != 0 goto label;
v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: boolean sslHandlerChecked> = 1;
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelPipeline pipeline()>();
v = interfaceinvoke v.<io.netty.channel.ChannelPipeline: io.netty.channel.ChannelHandler get(java.lang.Class)>(class "Lio/netty/handler/ssl/SslHandler;");
if v != null goto label;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
label:
return;
}
private void fireBufferedMessages()
{
io.netty.channel.ChannelHandlerContext v, v;
io.netty.util.internal.RecyclableArrayList v, v, v, v;
int v, v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
java.lang.Object v;
boolean v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
v = virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: boolean isEmpty()>();
if v != 0 goto label;
v = 0;
label:
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
v = virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: int size()>();
if v >= v goto label;
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.channel.ChannelHandlerContext ctx>;
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
v = virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: java.lang.Object get(int)>(v);
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelHandlerContext fireChannelRead(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.channel.ChannelHandlerContext ctx>;
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelHandlerContext fireChannelReadComplete()>();
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.RecyclableArrayList bufferedMessages>;
virtualinvoke v.<io.netty.util.internal.RecyclableArrayList: void clear()>();
label:
return;
}
public void userEventTriggered(io.netty.channel.ChannelHandlerContext, java.lang.Object) throws java.lang.Exception
{
java.lang.Throwable v, v;
java.lang.IllegalStateException v;
io.netty.channel.ChannelHandlerContext v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
java.lang.String v, v;
boolean v, v, v, v, v, v;
io.netty.channel.ChannelPipeline v;
io.netty.channel.ChannelHandler v;
java.lang.Object v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v := @parameter: java.lang.Object;
v = v instanceof io.netty.handler.ssl.SslHandshakeCompletionEvent;
if v == 0 goto label;
label:
v = virtualinvoke v.<io.netty.handler.ssl.SslHandshakeCompletionEvent: boolean isSuccess()>();
if v == 0 goto label;
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelPipeline pipeline()>();
v = interfaceinvoke v.<io.netty.channel.ChannelPipeline: io.netty.channel.ChannelHandler get(java.lang.Class)>(class "Lio/netty/handler/ssl/SslHandler;");
if v != null goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("cannot find an SslHandler in the pipeline (required for application-level protocol negotiation)");
throw v;
label:
v = virtualinvoke v.<io.netty.handler.ssl.SslHandler: java.lang.String applicationProtocol()>();
if v == null goto label;
v = v;
goto label;
label:
v = v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: java.lang.String fallbackProtocol>;
label:
virtualinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void configurePipeline(io.netty.channel.ChannelHandlerContext,java.lang.String)>(v, v);
label:
v = virtualinvoke v.<io.netty.handler.ssl.SslHandshakeCompletionEvent: boolean isSuccess()>();
if v == 0 goto label;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
goto label;
label:
v := @caughtexception;
virtualinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void exceptionCaught(io.netty.channel.ChannelHandlerContext,java.lang.Throwable)>(v, v);
label:
v = virtualinvoke v.<io.netty.handler.ssl.SslHandshakeCompletionEvent: boolean isSuccess()>();
if v == 0 goto label;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<io.netty.handler.ssl.SslHandshakeCompletionEvent: boolean isSuccess()>();
if v == 0 goto label;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
label:
throw v;
label:
v = v instanceof io.netty.channel.socket.ChannelInputShutdownEvent;
if v == 0 goto label;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void fireBufferedMessages()>();
label:
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelHandlerContext fireUserEventTriggered(java.lang.Object)>(v);
return;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
}
public void channelInactive(io.netty.channel.ChannelHandlerContext) throws java.lang.Exception
{
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
io.netty.channel.ChannelHandlerContext v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void fireBufferedMessages()>();
specialinvoke v.<io.netty.channel.ChannelInboundHandlerAdapter: void channelInactive(io.netty.channel.ChannelHandlerContext)>(v);
return;
}
private void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)
{
io.netty.channel.ChannelHandlerContext v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
io.netty.channel.ChannelPipeline v;
boolean v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelPipeline pipeline()>();
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: boolean isRemoved()>();
if v != 0 goto label;
interfaceinvoke v.<io.netty.channel.ChannelPipeline: io.netty.channel.ChannelPipeline remove(io.netty.channel.ChannelHandler)>(v);
label:
return;
}
protected abstract void configurePipeline(io.netty.channel.ChannelHandlerContext, java.lang.String) throws java.lang.Exception;
protected void handshakeFailure(io.netty.channel.ChannelHandlerContext, java.lang.Throwable) throws java.lang.Exception
{
io.netty.channel.Channel v;
java.lang.Throwable v;
io.netty.channel.ChannelHandlerContext v;
io.netty.util.internal.logging.InternalLogger v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v := @parameter: java.lang.Throwable;
v = <io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.logging.InternalLogger logger>;
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.Channel channel()>();
interfaceinvoke v.<io.netty.util.internal.logging.InternalLogger: void warn(java.lang.String,java.lang.Object,java.lang.Object)>("{} TLS handshake failed:", v, v);
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelFuture close()>();
return;
}
public void exceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable) throws java.lang.Exception
{
java.lang.Throwable v, v, v;
io.netty.channel.Channel v;
io.netty.channel.ChannelHandlerContext v;
io.netty.util.internal.logging.InternalLogger v;
io.netty.handler.ssl.ApplicationProtocolNegotiationHandler v;
boolean v, v;
v := @this: io.netty.handler.ssl.ApplicationProtocolNegotiationHandler;
v := @parameter: io.netty.channel.ChannelHandlerContext;
v := @parameter: java.lang.Throwable;
v = v instanceof io.netty.handler.codec.DecoderException;
if v == 0 goto label;
v = virtualinvoke v.<java.lang.Throwable: java.lang.Throwable getCause()>();
v = v instanceof javax.net.ssl.SSLException;
if v == 0 goto label;
label:
virtualinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void handshakeFailure(io.netty.channel.ChannelHandlerContext,java.lang.Throwable)>(v, v);
label:
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
return;
label:
v := @caughtexception;
specialinvoke v.<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: void removeSelfIfPresent(io.netty.channel.ChannelHandlerContext)>(v);
throw v;
label:
v = <io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.logging.InternalLogger logger>;
v = interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.Channel channel()>();
interfaceinvoke v.<io.netty.util.internal.logging.InternalLogger: void warn(java.lang.String,java.lang.Object,java.lang.Object)>("{} Failed to select the application-level protocol:", v, v);
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelHandlerContext fireExceptionCaught(java.lang.Throwable)>(v);
interfaceinvoke v.<io.netty.channel.ChannelHandlerContext: io.netty.channel.ChannelFuture close()>();
return;
catch java.lang.Throwable from label to label with label;
}
static void <clinit>()
{
io.netty.util.internal.logging.InternalLogger v;
v = staticinvoke <io.netty.util.internal.logging.InternalLoggerFactory: io.netty.util.internal.logging.InternalLogger getInstance(java.lang.Class)>(class "Lio/netty/handler/ssl/ApplicationProtocolNegotiationHandler;");
<io.netty.handler.ssl.ApplicationProtocolNegotiationHandler: io.netty.util.internal.logging.InternalLogger logger> = v;
return;
}
}