Set the 'handshaking' flag before calling beginHandshake() so that any failed handshake attempt can make SslHandler.handshake(Channel) return a failed future immediately.

This commit is contained in:
Trustin Lee 2009-10-22 10:29:39 +00:00
parent bf3da2d0e3
commit b4d2056f28

View File

@ -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;
}
}