From 8a130854936a7cb73ab9ffd7a94f6cc5af3d9d43 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 3 Apr 2019 09:18:41 +1100 Subject: [PATCH] Issue #3481 TLS Close Updates from review: - fixed flush return for NEED_UNWRAP Signed-off-by: Greg Wilkins --- .../src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java index eb64473de75..0d589c8a5a1 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java @@ -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);