Index: net/third_party/nss/ssl/sslsock.c |
=================================================================== |
--- net/third_party/nss/ssl/sslsock.c (revision 142005) |
+++ net/third_party/nss/ssl/sslsock.c (working copy) |
@@ -289,7 +289,7 @@ |
return ss; |
} |
-sslSocket * |
+static sslSocket * |
ssl_DupSocket(sslSocket *os) |
{ |
sslSocket *ss; |
@@ -1397,6 +1397,18 @@ |
return NULL; |
} |
+ /* |
+ * The session cache locks (cacheLock in sslnonce.c and symWrapKeysLock |
+ * in ssl3con.c) are always used when there is an sslSocket 'ss', |
+ * except for SSL_ClearSessionCache and SSL3_ShutdownServerCache. So |
+ * we can lazily initialize the session cache locks right before we |
+ * create an sslSocket. |
+ */ |
+ status = ssl_InitSessionCacheLocks(); |
+ if (status != SECSuccess) { |
+ return NULL; |
+ } |
+ |
if (model == NULL) { |
/* Just create a default socket if we're given NULL for the model */ |
ns = ssl_NewSocket((PRBool)(!ssl_defaults.noLocks), variant); |