JSSE: skip storeLock synchronization in printSessionStoreStatus() if debug not enabled, reduces thread contention
parent
5be4a99e0d
commit
81bc1c0deb
|
@ -548,9 +548,13 @@ public class WolfSSLDebug {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if debug logging is enabled for the specified component
|
||||
* Check if debug logging is enabled for the specified component.
|
||||
*
|
||||
* @param component the component to check (JNI or JSSE)
|
||||
*
|
||||
* @return true if debug logging is enabled for the component,
|
||||
*/
|
||||
private static boolean isDebugEnabled(Component component) {
|
||||
public static boolean isDebugEnabled(Component component) {
|
||||
if (component == Component.JSSE && DEBUG) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -534,6 +534,11 @@ public class WolfSSLAuthStore {
|
|||
* prints out host:port of all sessions stored in the store.
|
||||
* Called by getSession(). */
|
||||
private void printSessionStoreStatus() {
|
||||
|
||||
if (!WolfSSLDebug.isDebugEnabled(WolfSSLDebug.Component.JSSE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (storeLock) {
|
||||
Collection<WolfSSLImplementSSLSession> values =
|
||||
store.values();
|
||||
|
|
Loading…
Reference in New Issue