8254967: com.sun.net.HttpsServer spins on TLS session close

Reviewed-by: dfuchs
This commit is contained in:
Michael McMahon 2020-10-19 16:57:40 +00:00
parent 1da28de82f
commit 953e472ded

View File

@ -430,11 +430,16 @@ class SSLStreams {
handshaking.lock(); handshaking.lock();
ByteBuffer tmp = allocate(BufType.APPLICATION); ByteBuffer tmp = allocate(BufType.APPLICATION);
WrapperResult r; WrapperResult r;
Status st;
HandshakeStatus hs;
do { do {
tmp.clear(); tmp.clear();
tmp.flip (); tmp.flip ();
r = wrapper.wrapAndSendX (tmp, true); r = wrapper.wrapAndSendX (tmp, true);
} while (r.result.getStatus() != Status.CLOSED); hs = r.result.getHandshakeStatus();
st = r.result.getStatus();
} while (st != Status.CLOSED &&
!(st == Status.OK && hs == HandshakeStatus.NOT_HANDSHAKING));
} finally { } finally {
handshaking.unlock(); handshaking.unlock();
} }