Skip to content

Commit 953e472

Browse files
8254967: com.sun.net.HttpsServer spins on TLS session close
Reviewed-by: dfuchs
1 parent 1da28de commit 953e472

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jdk.httpserver/share/classes/sun/net/httpserver/SSLStreams.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,16 @@ void doClosure () throws IOException {
430430
handshaking.lock();
431431
ByteBuffer tmp = allocate(BufType.APPLICATION);
432432
WrapperResult r;
433+
Status st;
434+
HandshakeStatus hs;
433435
do {
434436
tmp.clear();
435437
tmp.flip ();
436438
r = wrapper.wrapAndSendX (tmp, true);
437-
} while (r.result.getStatus() != Status.CLOSED);
439+
hs = r.result.getHandshakeStatus();
440+
st = r.result.getStatus();
441+
} while (st != Status.CLOSED &&
442+
!(st == Status.OK && hs == HandshakeStatus.NOT_HANDSHAKING));
438443
} finally {
439444
handshaking.unlock();
440445
}

0 commit comments

Comments
 (0)