diff --git a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java index 1ea275690e..56e92f6e1d 100644 --- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java @@ -400,8 +400,8 @@ public class SslHandler } finally { if (bytesProduced > 0) { in.discardReadBytes(); - ctx.flush(future); } + ctx.flush(future); } } @@ -753,10 +753,8 @@ public class SslHandler final ScheduledFuture timeoutFuture = ctx.executor().schedule(new Runnable() { @Override public void run() { - if (future.setSuccess()) { - logger.warn("close_notify write attempt timed out. Force-closing the connection."); - ctx.close(ctx.newFuture()); - } + logger.warn(ctx.channel() + "close_notify write attempt timed out. Force-closing the connection."); + ctx.close(future); } }, 3, TimeUnit.SECONDS); // FIXME: Magic value