Issue #3481 TLS Close

Updates from review:
 - fixed flush return for NEED_UNWRAP

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2019-04-03 09:18:41 +11:00
parent 33e3894796
commit 8a13085493
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
@ -870,7 +871,8 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
if (filled < 0)
throw new IOException("Broken pipe");
}
return result = appOuts.length==1 && BufferUtil.isEmpty(appOuts[0]);
return result = BufferUtil.isEmpty(_encryptedOutput) &&
Arrays.stream(appOuts).mapToInt(ByteBuffer::remaining).sum()==0;
default:
throw new IllegalStateException("Unexpected HandshakeStatus " + status);