http-client-branch: merge with default http-client-branch
authorchegar
Mon, 23 Jul 2018 11:49:16 +0100
branchhttp-client-branch
changeset 56840 94b0c37babde
parent 56839 8ca7b2673b12 (diff)
parent 51182 b0fcf59be391 (current diff)
child 56841 d5fa8a463060
http-client-branch: merge with default
src/java.net.http/share/classes/java/net/http/HttpResponse.java
test/hotspot/gtest/utilities/utilitiesHelper.inline.hpp
test/hotspot/jtreg/applications/jcstress/acqrel/Test.java
test/hotspot/jtreg/applications/jcstress/atomicity/Test.java
test/hotspot/jtreg/applications/jcstress/copy/Test.java
test/hotspot/jtreg/applications/jcstress/fences/Test.java
test/hotspot/jtreg/applications/jcstress/memeffects/Test.java
test/hotspot/jtreg/applications/jcstress/other/Test.java
test/hotspot/jtreg/applications/jcstress/seqcst.sync/Test.java
test/hotspot/jtreg/applications/jcstress/seqcst.volatiles/Test.java
test/hotspot/jtreg/compiler/graalunit/JttLangMTest.java
test/hotspot/jtreg/compiler/graalunit/JttReflectFTest.java
test/hotspot/jtreg/runtime/appcds/MismatchedUseAppCDS.java
test/hotspot/jtreg/runtime/appcds/test-classes/CheckIfShared.java
test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java
test/jdk/ProblemList.txt
test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html
test/langtools/tools/javac/TryWithResources/WeirdTwr.out
test/langtools/tools/javac/file/zip/8003512/LoadClassFromJava6CreatedJarTest.java
test/langtools/tools/javac/warnings/6594914/T6594914b.out
--- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java	Fri Jul 20 14:48:41 2018 -0700
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java	Mon Jul 23 11:49:16 2018 +0100
@@ -297,7 +297,7 @@
         this.framesDecoder = new FramesDecoder(this::processFrame,
                 clientSettings.getParameter(SettingsFrame.MAX_FRAME_SIZE));
         // serverSettings will be updated by server
-        this.serverSettings = SettingsFrame.getDefaultSettings();
+        this.serverSettings = SettingsFrame.defaultRFCSettings();
         this.hpackOut = new Encoder(serverSettings.getParameter(HEADER_TABLE_SIZE));
         this.hpackIn = new Decoder(clientSettings.getParameter(HEADER_TABLE_SIZE));
         if (debugHpack.on()) {
@@ -430,12 +430,12 @@
 
         assert numReservedClientStreams >= 0;
         assert numReservedServerStreams >= 0;
-        if (clientInitiated && numReservedClientStreams >= getMaxConcurrentClientStreams()) {
+        if (clientInitiated &&numReservedClientStreams >= maxConcurrentClientInitiatedStreams()) {
             throw new IOException("too many concurrent streams");
         } else if (clientInitiated) {
             numReservedClientStreams++;
         }
-        if (!clientInitiated && numReservedServerStreams >= getMaxConcurrentServerStreams()) {
+        if (!clientInitiated && numReservedServerStreams >= maxConcurrentServerInitiatedStreams()) {
             return false;
         } else if (!clientInitiated) {
             numReservedServerStreams++;
@@ -580,11 +580,11 @@
         return serverSettings.getParameter(INITIAL_WINDOW_SIZE);
     }
 
-    final int getMaxConcurrentClientStreams() {
+    final int maxConcurrentClientInitiatedStreams() {
         return serverSettings.getParameter(MAX_CONCURRENT_STREAMS);
     }
 
-    final int getMaxConcurrentServerStreams() {
+    final int maxConcurrentServerInitiatedStreams() {
         return clientSettings.getParameter(MAX_CONCURRENT_STREAMS);
     }
 
--- a/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java	Fri Jul 20 14:48:41 2018 -0700
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java	Mon Jul 23 11:49:16 2018 +0100
@@ -161,15 +161,20 @@
         }
     }
 
-    public static final int DEFAULT_INITIAL_WINDOW_SIZE = 64 * K -1;
+    // The initial value is 4,096 octets.
     public static final int DEFAULT_HEADER_TABLE_SIZE = 4 * K;
-    public static final int DEFAULT_MAX_CONCURRENT_STREAMS = 100;
+    // The initial value is 1, which indicates that server push is permitted.
+    public static final int DEFAULT_ENABLE_PUSH = 1;
+    // Initially, there is no limit to this value. This limit is directional.
+    public static final int DEFAULT_MAX_CONCURRENT_STREAMS = Integer.MAX_VALUE;
+    // The initial value is 2^16-1 (65,535) octets.
+    public static final int DEFAULT_INITIAL_WINDOW_SIZE = 64 * K -1;
+    // The initial value is 2^14 (16,384) octets.
     public static final int DEFAULT_MAX_FRAME_SIZE = 16 * K;
 
-    public static SettingsFrame getDefaultSettings() {
+    public static SettingsFrame defaultRFCSettings() {
         SettingsFrame f = new SettingsFrame();
-        // TODO: check these values
-        f.setParameter(ENABLE_PUSH, 1);
+        f.setParameter(ENABLE_PUSH, DEFAULT_ENABLE_PUSH);
         f.setParameter(HEADER_TABLE_SIZE, DEFAULT_HEADER_TABLE_SIZE);
         f.setParameter(MAX_CONCURRENT_STREAMS, DEFAULT_MAX_CONCURRENT_STREAMS);
         f.setParameter(INITIAL_WINDOW_SIZE, DEFAULT_INITIAL_WINDOW_SIZE);
--- a/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java	Fri Jul 20 14:48:41 2018 -0700
+++ b/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java	Mon Jul 23 11:49:16 2018 +0100
@@ -156,7 +156,7 @@
     };
 
     private SettingsFrame getServerSettingProperties() {
-        SettingsFrame s = SettingsFrame.getDefaultSettings();
+        SettingsFrame s = SettingsFrame.defaultRFCSettings();
         if (properties == null)
             return s;
         for (int i=0; i<propIDs.length; i++) {