Skip to content

Commit 5494778

Browse files
committed
simplify.
1 parent 44a4c88 commit 5494778

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -698,16 +698,10 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
698698
// Successfully negotiated the protocol.
699699
logSslEngineDetails(Level.FINER, ctx, "TLS negotiation succeeded.", null);
700700
propagateTlsComplete(ctx, handler.engine().getSession());
701-
if (handshakeCompleteRunnable.isPresent()) {
702-
handshakeCompleteRunnable.get().run();
703-
}
704701
} else {
705702
Exception ex =
706703
unavailableException("Failed ALPN negotiation: Unable to find compatible protocol");
707704
logSslEngineDetails(Level.FINE, ctx, "TLS negotiation failed.", ex);
708-
if (handshakeCompleteRunnable.isPresent()) {
709-
handshakeCompleteRunnable.get().run();
710-
}
711705
ctx.fireExceptionCaught(ex);
712706
}
713707
} else {
@@ -722,15 +716,12 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
722716
.withCause(t)
723717
.asRuntimeException();
724718
}
725-
if (handshakeCompleteRunnable.isPresent()) {
726-
handshakeCompleteRunnable.get().run();
727-
}
728719
ctx.fireExceptionCaught(t);
729720
}
730-
} else {
731721
if (handshakeCompleteRunnable.isPresent()) {
732722
handshakeCompleteRunnable.get().run();
733723
}
724+
} else {
734725
super.userEventTriggered0(ctx, evt);
735726
}
736727
}

0 commit comments

Comments
 (0)