diff options
author | Radek Doulik <rodo@ximian.com> | 2004-12-02 01:46:25 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-12-02 01:46:25 +0800 |
commit | 2f0ee5072922264356bce9ab46f59b391bac9896 (patch) | |
tree | 606f2152cf4965580d9205cdaced00eee5949a52 /mail | |
parent | 36948023ffbc80bb96bb2f9357640095bc45e409 (diff) | |
download | gsoc2013-evolution-2f0ee5072922264356bce9ab46f59b391bac9896.tar.gz gsoc2013-evolution-2f0ee5072922264356bce9ab46f59b391bac9896.tar.zst gsoc2013-evolution-2f0ee5072922264356bce9ab46f59b391bac9896.zip |
do not call gconf here as we may be called from worker thread
2004-11-25 Radek Doulik <rodo@ximian.com>
* em-junk-filter.c (em_junk_sa_test_spamd): do not call gconf here
as we may be called from worker thread
(em_junk_filter_get_plugin): read alternative spam[cd] binaries
paths here, use init lock to be sure no one is accessing spam[cd]
binaries paths
Fixes #69623
svn path=/trunk/; revision=28034
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/em-junk-filter.c | 33 |
2 files changed, 29 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 4990848fe5..fd246bba34 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2004-11-25 Radek Doulik <rodo@ximian.com> + + * em-junk-filter.c (em_junk_sa_test_spamd): do not call gconf here + as we may be called from worker thread + (em_junk_filter_get_plugin): read alternative spam[cd] binaries + paths here, use init lock to be sure no one is accessing spam[cd] + binaries paths + + Fixes #69623 + 2004-12-01 Mengjie Yu <meng-jie.yu@sun.com> * em-account-editor.c: (emae_option_toggle), diff --git a/mail/em-junk-filter.c b/mail/em-junk-filter.c index 4084dbb825..f9b74a8c0c 100644 --- a/mail/em-junk-filter.c +++ b/mail/em-junk-filter.c @@ -101,6 +101,9 @@ static char *em_junk_sa_spamd_binaries [3] = {"spamd", "/usr/sbin/spamd", NULL}; static time_t em_junk_sa_spamd_restarts [SPAMD_RESTARTS_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0}; static int em_junk_sa_spamd_restarts_count = 0; +char *em_junk_sa_spamc_gconf_binary = NULL; +char *em_junk_sa_spamd_gconf_binary = NULL; + static const char * em_junk_sa_get_name (void) { @@ -398,21 +401,16 @@ em_junk_sa_test_spamd (void) int i, b; gboolean try_system_spamd = TRUE; - if (em_junk_sa_gconf) { - char *binary; - - binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamc_binary", NULL); - if (binary) { - em_junk_sa_spamc_binaries [0] = binary; - em_junk_sa_spamc_binaries [1] = NULL; - } - binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamd_binary", NULL); - if (binary) { - em_junk_sa_spamd_binaries [0] = binary; - em_junk_sa_spamd_binaries [1] = NULL; - try_system_spamd = FALSE; - } + if (em_junk_sa_spamc_gconf_binary) { + em_junk_sa_spamc_binaries [0] = em_junk_sa_spamc_gconf_binary; + em_junk_sa_spamc_binaries [1] = NULL; } + + if (em_junk_sa_spamd_gconf_binary) { + em_junk_sa_spamd_binaries [0] = em_junk_sa_spamd_gconf_binary; + em_junk_sa_spamd_binaries [1] = NULL; + try_system_spamd = FALSE; + } em_junk_sa_use_spamc = FALSE; @@ -703,6 +701,8 @@ em_junk_filter_get_plugin (void) static void em_junk_sa_init (void) { + pthread_mutex_lock (&em_junk_sa_init_lock); + if (!em_junk_sa_gconf) { em_junk_sa_gconf = gconf_client_get_default(); gconf_client_add_dir (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); @@ -718,8 +718,13 @@ em_junk_sa_init (void) gconf_client_notify_add(em_junk_sa_gconf, "/apps/evolution/mail/junk/sa", (GConfClientNotifyFunc)em_junk_sa_setting_notify, NULL, NULL, NULL); + + em_junk_sa_spamc_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamc_binary", NULL); + em_junk_sa_spamd_gconf_binary = gconf_client_get_string (em_junk_sa_gconf, "/apps/evolution/mail/junk/sa/spamd_binary", NULL); } + pthread_mutex_unlock (&em_junk_sa_init_lock); + atexit (em_junk_sa_finalize); } |