Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
// Successfully negotiated the protocol.
logSslEngineDetails(Level.FINER, ctx, "TLS negotiation succeeded.", null);
propagateTlsComplete(ctx, handler.engine().getSession());
if (handshakeCompleteRunnable.isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to have a single copy of the code within the evt instanceof SslHandshakeCompletionEvent block?

handshakeCompleteRunnable.get().run();
}
} else {
Exception ex =
unavailableException("Failed ALPN negotiation: Unable to find compatible protocol");
Expand Down Expand Up @@ -725,6 +728,9 @@ protected void userEventTriggered0(ChannelHandlerContext ctx, Object evt) throws
ctx.fireExceptionCaught(t);
}
} else {
if (handshakeCompleteRunnable.isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete. We have no clue what this event was; it could be anything.

handshakeCompleteRunnable.get().run();
}
super.userEventTriggered0(ctx, evt);
}
}
Expand Down