1 diff -u --recursive curl-7.18.2/lib/nss.c curl-7.18.2.new/lib/nss.c
2 --- curl-7.18.2/lib/nss.c 2008-09-16 11:13:00.000000000 -0400
3 +++ curl-7.18.2.new/lib/nss.c 2008-09-16 11:29:13.000000000 -0400
6 PRFileDesc *PR_ImportTCPSocket(PRInt32 osfd);
8 +PRLock * nss_initlock = NULL;
12 #define HANDSHAKE_TIMEOUT 30
15 int Curl_nss_init(void)
18 + /* curl_global_init() is not thread-safe so this test is ok */
19 + if (nss_initlock == NULL) {
20 PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 256);
21 + nss_initlock = PR_NewLock();
24 /* We will actually initialize NSS later */
28 void Curl_nss_cleanup(void)
31 + /* This function isn't required to be threadsafe and this is only done
32 + * as a safety feature.
34 + PR_Lock(nss_initlock);
37 + PR_Unlock(nss_initlock);
39 + PR_DestroyLock(nss_initlock);
40 + nss_initlock = NULL;
48 /* FIXME. NSS doesn't support multiple databases open at the same time. */
50 + PR_Lock(nss_initlock);
51 + if(!initialized && !NSS_IsInitialized()) {
54 certDir = getenv("SSL_DIR"); /* Look in $SSL_DIR */
56 if(rv != SECSuccess) {
57 infof(conn->data, "Unable to initialize NSS database\n");
58 curlerr = CURLE_SSL_CACERT_BADFILE;
59 + PR_Unlock(nss_initlock);
68 + PR_Unlock(nss_initlock);
70 model = PR_NewTCPSocket();
72 Only in curl-7.18.2.new/lib: nss.c.orig