From b4d2056f28235e86b4edf6444f3bfe07738f6740 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 22 Oct 2009 10:29:39 +0000 Subject: [PATCH] Set the 'handshaking' flag before calling beginHandshake() so that any failed handshake attempt can make SslHandler.handshake(Channel) return a failed future immediately. --- src/main/java/org/jboss/netty/handler/ssl/SslHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java index 260c61a788..107b7cc271 100644 --- a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java +++ b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java @@ -311,6 +311,7 @@ public class SslHandler extends FrameDecoder implements ChannelDownstreamHandler if (handshaking) { return this.handshakeFuture; } else { + handshaking = true; try { engine.beginHandshake(); runDelegatedTasks(); @@ -318,7 +319,6 @@ public class SslHandler extends FrameDecoder implements ChannelDownstreamHandler } catch (SSLException e) { handshakeFuture = this.handshakeFuture = failedFuture(channel, e); } - handshaking = true; } }