Made sure unwrap is called for all NEED_UNWRAP handshake status

This commit is contained in:
Trustin Lee 2008-11-16 15:14:32 +00:00
parent dce019966e
commit 62ed58a2be

View File

@ -421,6 +421,7 @@ public class SslHandler extends FrameDecoder {
ByteBuffer outNetBuf = bufferPool.acquire();
boolean success = true;
boolean offered = false;
boolean needsUnwrap = false;
try {
loop:
for (;;) {
@ -475,6 +476,7 @@ public class SslHandler extends FrameDecoder {
break loop;
}
case NEED_UNWRAP:
needsUnwrap = true;
break loop;
case NEED_TASK:
runDelegatedTasks();
@ -527,6 +529,10 @@ public class SslHandler extends FrameDecoder {
}
}
if (needsUnwrap) {
unwrap(context, channel, ChannelBuffers.EMPTY_BUFFER, 0, 0);
}
if (future == null) {
future = succeededFuture(channel);
}
@ -587,8 +593,10 @@ public class SslHandler extends FrameDecoder {
case NEED_TASK:
runDelegatedTasks();
break;
case NOT_HANDSHAKING:
case NEED_UNWRAP:
unwrap(ctx, channel, ChannelBuffers.EMPTY_BUFFER, 0, 0);
break;
case NOT_HANDSHAKING:
case NEED_WRAP:
break;
default: