src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java
changeset 54816 b27f33bef884
parent 54443 dfba4e321ab3
--- a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java	Fri May 10 20:56:37 2019 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java	Fri May 10 12:33:40 2019 -0700
@@ -237,9 +237,8 @@
                     fragLen = Record.maxDataSize;
                 }
 
-                if (fragmentSize > 0) {
-                    fragLen = Math.min(fragLen, fragmentSize);
-                }
+                // Calculate more impact, for example TLS 1.3 padding.
+                fragLen = calculateFragmentSize(fragLen);
             }
 
             int dstPos = destination.position();
@@ -444,9 +443,8 @@
                 fragLen = Record.maxDataSize;
             }
 
-            if (fragmentSize > 0) {
-                fragLen = Math.min(fragLen, fragmentSize);
-            }
+            // Calculate more impact, for example TLS 1.3 padding.
+            fragLen = calculateFragmentSize(fragLen);
 
             int dstPos = dstBuf.position();
             int dstLim = dstBuf.limit();