diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-03-14 07:31:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-03-14 07:31:32 +0800 |
commit | e31313b07f2f57e3fe8b3340ae410a7a13e71607 (patch) | |
tree | abcf8f0fd64769ac45eb6699ed9f36e3d6226c46 /camel/camel.c | |
parent | 2f96c6db974180f9a9e88b89386e599edb9b21d6 (diff) | |
download | gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar.gz gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar.bz2 gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar.lz gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar.xz gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.tar.zst gsoc2013-evolution-e31313b07f2f57e3fe8b3340ae410a7a13e71607.zip |
Since all of the Mozilla libs (including NSPR and NSS) correctly handle
2001-03-13 Jeffrey Stedfast <fejj@ximian.com>
* camel.c (camel_init): Since all of the Mozilla libs (including
NSPR and NSS) correctly handle reinitializations, we might as well
init both NSPR and NSS in camel_init so we can be sure of that
these libs have been initialized.
(camel_shutdown): New function to call the NSS cleanup stuff.
svn path=/trunk/; revision=8690
Diffstat (limited to 'camel/camel.c')
-rw-r--r-- | camel/camel.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/camel/camel.c b/camel/camel.c index c451045c32..4aa4512722 100644 --- a/camel/camel.c +++ b/camel/camel.c @@ -28,6 +28,7 @@ #include <unicode.h> #ifdef HAVE_NSS #include <mozilla/nspr.h> +#include <mozilla/prthread.h> #include <nss.h> #include <ssl.h> #endif /* HAVE_NSS */ @@ -35,13 +36,13 @@ gboolean camel_verbose_debug = FALSE; gint -camel_init (void) +camel_init (const char *certdb) { #ifdef ENABLE_THREADS #ifdef G_THREADS_ENABLED /*g_thread_init (NULL);*/ #else /* G_THREADS_ENABLED */ - g_warning ("Threads are not supported by your version of glib\n"); + g_warning ("Threads are not supported by your version of glib"); #endif /* G_THREADS_ENABLED */ #endif /* ENABLE_THREADS */ @@ -51,6 +52,15 @@ camel_init (void) unicode_init (); #ifdef HAVE_NSS + PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10); + + if (NSS_Init (certdb) == SECFailure) { + g_warning ("Failed to initialize NSS"); + return -1; + } + + NSS_SetDomesticPolicy (); + SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE); SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE); SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE); @@ -59,3 +69,13 @@ camel_init (void) return 0; } + +void +camel_shutdown (void) +{ +#ifdef HAVE_NSS + NSS_Shutdown (); + + PR_Cleanup (); +#endif /* HAVE_NSS */ +} |