http-client-branch: fix a race condition tickled by TLS 1.3 handshake http-client-branch
authordfuchs
Tue, 03 Jul 2018 11:02:57 +0200
branchhttp-client-branch
changeset 56817 167f07a3512d
parent 56814 97522a3141c2
child 56818 c76f4aa16140
http-client-branch: fix a race condition tickled by TLS 1.3 handshake
src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java
--- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java	Fri Jun 29 19:56:40 2018 +0200
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java	Tue Jul 03 11:02:57 2018 +0200
@@ -1029,6 +1029,10 @@
             case NEED_UNWRAP_AGAIN:
                 // do nothing else
                 // receiving-side data will trigger unwrap
+                if (caller == WRITER) {
+                    reader.schedule();
+                    return false;
+                }
                 break;
             default:
                 throw new InternalError("Unexpected handshake status:"