diff options
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel.c | 24 | ||||
-rw-r--r-- | camel/camel.h | 4 |
3 files changed, 33 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c0b391e099..9fea64d53c 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,13 @@ 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. + +2001-03-13 Jeffrey Stedfast <fejj@ximian.com> + * camel-folder.c (camel_folder_copy_message_to): Don't allow the user to copy a message to or from the vtrash folder. Set an exception if they try. 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 */ +} diff --git a/camel/camel.h b/camel/camel.h index 6de1ae6462..fc50f3eb35 100644 --- a/camel/camel.h +++ b/camel/camel.h @@ -68,7 +68,9 @@ extern "C" { #include <camel/hash-table-utils.h> #include <camel/string-utils.h> -gint camel_init (void); +gint camel_init (const char *certdb); + +void camel_shutdown (void); #ifdef __cplusplus } |