summaryrefslogtreecommitdiff
path: root/security/nss/lib/ssl/sslnonce.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/ssl/sslnonce.c')
-rw-r--r--security/nss/lib/ssl/sslnonce.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/security/nss/lib/ssl/sslnonce.c b/security/nss/lib/ssl/sslnonce.c
index dc27d8f5f..3e5ed37a6 100644
--- a/security/nss/lib/ssl/sslnonce.c
+++ b/security/nss/lib/ssl/sslnonce.c
@@ -54,8 +54,8 @@
PRUint32 ssl_sid_timeout = 100;
PRUint32 ssl3_sid_timeout = 86400L; /* 24 hours */
-static sslSessionID *cache;
-static PZLock * cacheLock;
+static sslSessionID *cache = NULL;
+static PZLock * cacheLock = NULL;
/* sids can be in one of 4 states:
*
@@ -68,14 +68,16 @@ static PZLock * cacheLock;
#define LOCK_CACHE lock_cache()
#define UNLOCK_CACHE PZ_Unlock(cacheLock)
-static void
-lock_cache(void)
+void ssl_InitClientSessionCacheLock(void)
{
- /* XXX Since the client session cache has no init function, we must
- * XXX init the cacheLock on the first call. Fix in NSS 3.0.
- */
if (!cacheLock)
nss_InitLock(&cacheLock, nssILockCache);
+}
+
+static void
+lock_cache(void)
+{
+ ssl_InitClientSessionCacheLock();
PZ_Lock(cacheLock);
}