From e61d136dd95b9f136eb85d9d1f4c3615a6184c69 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Sun, 16 Mar 2008 23:46:27 -0400 Subject: [PATCH] 6542796: CPU issue with JSSE and tomcat Record length count error Reviewed-by: weijun --- .../classes/sun/security/ssl/InputRecord.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/sun/security/ssl/InputRecord.java b/jdk/src/share/classes/sun/security/ssl/InputRecord.java index 56ea2b0483e..c0e3e4aa526 100644 --- a/jdk/src/share/classes/sun/security/ssl/InputRecord.java +++ b/jdk/src/share/classes/sun/security/ssl/InputRecord.java @@ -426,12 +426,12 @@ class InputRecord extends ByteArrayInputStream implements Record { if (really < 0) { throw new SSLException("SSL peer shut down incorrectly"); } - - // now we've got a complete record. - count = contentLen + headerSize; - exlen = 0; } + // now we've got a complete record. + count = contentLen + headerSize; + exlen = 0; + if (debug != null && Debug.isOn("record")) { if (count < 0 || count > (maxRecordSize - headerSize)) { System.out.println(Thread.currentThread().getName() @@ -502,10 +502,11 @@ class InputRecord extends ByteArrayInputStream implements Record { if (really < 0) { throw new EOFException("SSL peer shut down incorrectly"); } - - // now we've got a complete record. - exlen = 0; } + + // now we've got a complete record. + exlen = 0; + hashInternal(buf, 2, 3); hashInternal(v2Buf, 0, len); V2toV3ClientHello(v2Buf);