Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: net/third_party/nss/ssl/sslsock.c

Issue 10539144: Always initialize session cache locks lazily. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unrelated cleanup Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * vtables (and methods that call through them) for the 4 types of 2 * vtables (and methods that call through them) for the 4 types of
3 * SSLSockets supported. Only one type is still supported. 3 * SSLSockets supported. Only one type is still supported.
4 * Various other functions. 4 * Various other functions.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
8 * 8 *
9 * The contents of this file are subject to the Mozilla Public License Version 9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with 10 * 1.1 (the "License"); you may not use this file except in compliance with
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 { 1390 {
1391 sslSocket * ns = NULL; 1391 sslSocket * ns = NULL;
1392 PRStatus rv; 1392 PRStatus rv;
1393 PRNetAddr addr; 1393 PRNetAddr addr;
1394 SECStatus status = ssl_Init(); 1394 SECStatus status = ssl_Init();
1395 1395
1396 if (status != SECSuccess) { 1396 if (status != SECSuccess) {
1397 return NULL; 1397 return NULL;
1398 } 1398 }
1399 1399
1400 /*
1401 * The session cache locks (cacheLock in sslnonce.c and symWrapKeysLock
1402 * in ssl3con.c) are always used when there is an sslSocket 'ss',
1403 * except for SSL_ClearSessionCache and SSL3_ShutdownServerCache. So
1404 * we can lazily initialize the session cache locks right before we
1405 * create an sslSocket.
1406 */
Ryan Sleevi 2012/06/14 01:23:34 See my other comment - I don't think this is corre
1407 status = ssl_InitSessionCacheLocks();
1408 if (status != SECSuccess) {
1409 return NULL;
1410 }
1411
1400 if (model == NULL) { 1412 if (model == NULL) {
1401 /* Just create a default socket if we're given NULL for the model */ 1413 /* Just create a default socket if we're given NULL for the model */
1402 ns = ssl_NewSocket((PRBool)(!ssl_defaults.noLocks), variant); 1414 ns = ssl_NewSocket((PRBool)(!ssl_defaults.noLocks), variant);
1403 } else { 1415 } else {
1404 sslSocket * ss = ssl_FindSocket(model); 1416 sslSocket * ss = ssl_FindSocket(model);
1405 if (ss == NULL || ss->protocolVariant != variant) { 1417 if (ss == NULL || ss->protocolVariant != variant) {
1406 SSL_DBG(("%d: SSL[%d]: bad model socket in ssl_ImportFD", 1418 SSL_DBG(("%d: SSL[%d]: bad model socket in ssl_ImportFD",
1407 SSL_GETPID(), model)); 1419 SSL_GETPID(), model));
1408 return NULL; 1420 return NULL;
1409 } 1421 }
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 ssl_DestroySocketContents(ss); 3053 ssl_DestroySocketContents(ss);
3042 ssl_DestroyLocks(ss); 3054 ssl_DestroyLocks(ss);
3043 PORT_Free(ss); 3055 PORT_Free(ss);
3044 ss = NULL; 3056 ss = NULL;
3045 } 3057 }
3046 ss->protocolVariant = protocolVariant; 3058 ss->protocolVariant = protocolVariant;
3047 } 3059 }
3048 return ss; 3060 return ss;
3049 } 3061 }
3050 3062
OLDNEW
« net/third_party/nss/ssl/sslsnce.c ('K') | « net/third_party/nss/ssl/sslsnce.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698