From 3fff8ce1d63817cb92553c7ec33c90c73dd02119 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sun, 8 Jul 2012 15:11:46 +0900 Subject: [PATCH] Fixed a bug where SslHandler does not sometimes forward a flush request --- .../src/main/java/io/netty/handler/ssl/SslHandler.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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