An experimental workaround for infinite blocking SSLEngine

This commit is contained in:
Trustin Lee 2009-04-08 22:12:29 +00:00
parent 763d0cf809
commit 25a2ade130

View File

@ -645,13 +645,14 @@ public class SslHandler extends FrameDecoder {
for (;;) { for (;;) {
SSLEngineResult result; SSLEngineResult result;
synchronized (handshakeLock) { synchronized (handshakeLock) {
boolean outboundDone = engine.isOutboundDone();
if (initialHandshake && !engine.getUseClientMode() && if (initialHandshake && !engine.getUseClientMode() &&
!engine.isInboundDone() && !engine.isOutboundDone()) { !engine.isInboundDone() && !outboundDone) {
handshake(channel); handshake(channel);
initialHandshake = false; initialHandshake = false;
} }
if (channel.getCloseFuture().isDone()) { if (outboundDone && !channel.isConnected()) {
ChannelFuture handshakeFuture = this.handshakeFuture; ChannelFuture handshakeFuture = this.handshakeFuture;
if (handshakeFuture != null && if (handshakeFuture != null &&
handshakeFuture.getCause() != null) { handshakeFuture.getCause() != null) {