ASF Bugzilla – Attachment 24171 Details for
Bug 47744
Memory leak when using SSL + Java security manager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for this issue.
sslsession-memory-fix.patch (text/plain), 1.43 KB, created by
Greg Vanore
on 2009-08-26 11:02:48 UTC
(
hide
)
Description:
Patch for this issue.
Filename:
MIME Type:
Creator:
Greg Vanore
Created:
2009-08-26 11:02:48 UTC
Size:
1.43 KB
patch
obsolete
>--- apache-tomcat-6.0.20-src/java/org/apache/tomcat/util/net/jsse/JSSESupport.java Thu May 14 01:15:16 2009 >+++ apache-tomcat-6.0.20-src-fix/java/org/apache/tomcat/util/net/jsse/JSSESupport.java Wed Aug 26 11:15:41 2009 >@@ -23,6 +23,8 @@ > import java.net.SocketException; > import java.security.cert.Certificate; > import java.security.cert.CertificateFactory; >+import java.util.Map; >+import java.util.WeakHashMap; > > import javax.net.ssl.HandshakeCompletedEvent; > import javax.net.ssl.HandshakeCompletedListener; >@@ -52,6 +54,8 @@ > > private static org.apache.juli.logging.Log log = > org.apache.juli.logging.LogFactory.getLog(JSSESupport.class); >+ private static final Map<SSLSession, Integer> keySizeCache = >+ new WeakHashMap<SSLSession, Integer>(10); > > protected SSLSocket ssl; > protected SSLSession session; >@@ -186,7 +190,7 @@ > SSLSupport.CipherData c_aux[]=ciphers; > if (session == null) > return null; >- Integer keySize = (Integer) session.getValue(KEY_SIZE_KEY); >+ Integer keySize = (Integer) keySizeCache.get(session); > if (keySize == null) { > int size = 0; > String cipherSuite = session.getCipherSuite(); >@@ -197,7 +201,7 @@ > } > } > keySize = new Integer(size); >- session.putValue(KEY_SIZE_KEY, keySize); >+ keySizeCache.put(session, keySize); > } > return keySize; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47744
:
24170
| 24171