Skip to content

Commit

Permalink
Ignore SslHandshakeCompletionEvent (line#1874)
Browse files Browse the repository at this point in the history
Motivation:

Since Netty 4.1.37, `SslHandler` emits an `SslHandshakeCompletionEvent`
when a TLS handshake is complete. It triggers a log message at WARN
level currently.

Modifications:

- Add `SslHandshakeCompletionEvent` to the known user events.

Result:

- Less noise
  • Loading branch information
trustin authored Jul 2, 2019
1 parent 0a2dcfc commit 294e987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import io.netty.handler.codec.http2.Http2ConnectionPrefaceAndSettingsFrameWrittenEvent;
import io.netty.handler.codec.http2.Http2Settings;
import io.netty.handler.ssl.SslCloseCompletionEvent;
import io.netty.handler.ssl.SslHandshakeCompletionEvent;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.concurrent.Promise;

Expand Down Expand Up @@ -284,6 +285,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc
}

if (evt instanceof Http2ConnectionPrefaceAndSettingsFrameWrittenEvent ||
evt instanceof SslHandshakeCompletionEvent ||
evt instanceof SslCloseCompletionEvent ||
evt instanceof ChannelInputShutdownReadComplete) {
// Expected events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import io.netty.handler.codec.http2.Http2Settings;
import io.netty.handler.ssl.SslCloseCompletionEvent;
import io.netty.handler.ssl.SslHandler;
import io.netty.handler.ssl.SslHandshakeCompletionEvent;

final class HttpServerHandler extends ChannelInboundHandlerAdapter implements HttpServer {

Expand Down Expand Up @@ -643,7 +644,8 @@ public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {

@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof SslCloseCompletionEvent ||
if (evt instanceof SslHandshakeCompletionEvent ||
evt instanceof SslCloseCompletionEvent ||
evt instanceof ChannelInputShutdownReadComplete) {
// Expected events
return;
Expand Down

0 comments on commit 294e987

Please sign in to comment.