diff options
-rw-r--r-- | camel/ChangeLog | 36 | ||||
-rw-r--r-- | camel/camel-filter-driver.c | 5 | ||||
-rw-r--r-- | camel/camel-folder-search.c | 5 | ||||
-rw-r--r-- | camel/camel-lock.c | 2 | ||||
-rw-r--r-- | camel/camel-movemail.c | 2 | ||||
-rw-r--r-- | camel/camel-operation.c | 9 | ||||
-rw-r--r-- | camel/camel-uid-cache.c | 8 | ||||
-rw-r--r-- | camel/providers/local/camel-local-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 2 |
9 files changed, 58 insertions, 15 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index f68d97d54f..8a690a815c 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,39 @@ +2004-09-21 Not Zed <NotZed@Ximian.com> + + ** See bug #63521. + + * camel-movemail.c (camel_movemail): don't clear exception on entry. + + * camel-folder-search.c (match_words_message): use local exception. + + * camel-operation.c (camel_operation_cancel_check): soak up all + cancellation requests as soon as we get one. + (camel_operation_uncancel): soak up all cancellation reqeusts when + we uncancel. + + * camel-uid-cache.c (camel_uid_cache_save): open the file O_TRUNC + rather than O_EXCL, otherwise a crash would mean this file never + gets updated. + (camel_uid_cache_save): block cancellation around writes otherwise + we could be interupted from old cancellation. + + * providers/local/camel-local-folder.c + (camel_local_folder_construct): don't clear exception here, just + don't pass it to summary load. + + * providers/pop3/camel-pop3-store.c (pop3_connect): only clear the + exception when we received one we handled. + + * camel-filter-driver.c (close_folder): if exception is already + set, don't pass it to folder.sync(). + + * camel-lock.c (camel_lock_folder): don't clear the exception + here, if it came in set its a programming error. + + * camel-filter-driver.c (camel_filter_driver_filter_message): if + the exception is set after evaluating the expression, stop + immediately. + 2004-09-13 Not Zed <NotZed@Ximian.com> ** See bug #47821. diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index cf9889491e..dfb88b84ed 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -937,7 +937,7 @@ close_folder (void *key, void *value, void *data) g_free (key); if (folder != FOLDER_INVALID) { - camel_folder_sync (folder, FALSE, p->ex); + camel_folder_sync (folder, FALSE, camel_exception_is_set(p->ex)?NULL : p->ex); camel_folder_thaw (folder); camel_object_unref (folder); } @@ -1422,6 +1422,9 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage goto error; } r = e_sexp_eval (p->eval); + if (camel_exception_is_set(p->ex)) + goto error; + if (r == NULL) { camel_exception_setv (ex, 1, _("Error executing filter: %s: %s"), e_sexp_error (p->eval), node->action); diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index bb570b8e44..b7578ba887 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -1109,15 +1109,16 @@ match_words_message(CamelFolder *folder, const char *uid, struct _camel_search_w { guint32 mask; CamelMimeMessage *msg; + CamelException x = CAMEL_EXCEPTION_INITIALISER; int truth; - msg = camel_folder_get_message(folder, uid, ex); + msg = camel_folder_get_message(folder, uid, &x); if (msg) { mask = 0; truth = match_words_1message((CamelDataWrapper *)msg, words, &mask); camel_object_unref((CamelObject *)msg); } else { - camel_exception_clear(ex); + camel_exception_clear(&x); truth = FALSE; } diff --git a/camel/camel-lock.c b/camel/camel-lock.c index dd52daa882..eeae181f5b 100644 --- a/camel/camel-lock.c +++ b/camel/camel-lock.c @@ -314,8 +314,6 @@ camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException * if (retry > 0) sleep(CAMEL_LOCK_DELAY); - camel_exception_clear(ex); - if (camel_lock_fcntl(fd, type, ex) == 0) { if (camel_lock_flock(fd, type, ex) == 0) { if (camel_lock_dot(path, ex) == 0) diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c index 521d21d0ca..619d3dc33a 100644 --- a/camel/camel-movemail.c +++ b/camel/camel-movemail.c @@ -91,8 +91,6 @@ camel_movemail(const char *source, const char *dest, CamelException *ex) int sfd, dfd; struct stat st; - camel_exception_clear(ex); - /* Stat and then open the spool file. If it doesn't exist or * is empty, the user has no mail. (There's technically a race * condition here in that an MDA might have just now locked it diff --git a/camel/camel-operation.c b/camel/camel-operation.c index 7c641251b4..adf4c981b1 100644 --- a/camel/camel-operation.c +++ b/camel/camel-operation.c @@ -334,7 +334,12 @@ camel_operation_uncancel(CamelOperation *cc) cc = (CamelOperation *)pthread_getspecific(operation_key); if (cc) { + CamelOperationMsg *msg; + LOCK(); + while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port))) + g_free(msg); + cc->flags &= ~CAMEL_OPERATION_CANCELLED; UNLOCK(); } @@ -406,7 +411,9 @@ camel_operation_cancel_check (CamelOperation *cc) cancelled = TRUE; } else if ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port))) { d(printf("Got cancellation message\n")); - g_free(msg); + do { + g_free(msg); + } while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port))); cc->flags |= CAMEL_OPERATION_CANCELLED; cancelled = TRUE; } else diff --git a/camel/camel-uid-cache.c b/camel/camel-uid-cache.c index 2a2a52daeb..f884c11851 100644 --- a/camel/camel-uid-cache.c +++ b/camel/camel-uid-cache.c @@ -153,7 +153,7 @@ camel_uid_cache_save (CamelUIDCache *cache) int fd; filename = g_strdup_printf ("%s~", cache->filename); - if ((fd = open (filename, O_WRONLY | O_CREAT | O_EXCL, 0666)) == -1) { + if ((fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) { g_free (filename); return FALSE; } @@ -267,7 +267,7 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids) new_uids = g_ptr_array_new (); cache->level++; - + for (i = 0; i < uids->len; i++) { struct _uid_state *state; @@ -303,7 +303,7 @@ camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid) gpointer old_uid; g_return_if_fail (uid != NULL); - + if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) { state->save = TRUE; state->level = cache->level; @@ -311,7 +311,7 @@ camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid) state = g_new (struct _uid_state, 1); state->save = TRUE; state->level = cache->level; - + g_hash_table_insert (cache->uids, g_strdup (uid), state); } } diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 4f15336785..5900d48bea 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -301,8 +301,8 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con } folder->summary = (CamelFolderSummary *)CLOCALF_CLASS(lf)->create_summary(lf->summary_path, lf->folder_path, lf->index); - if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, ex) == -1) { - camel_exception_clear(ex); + if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, NULL) == -1) { + /* ? */ } /*if (camel_local_summary_check((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {*/ diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 4e5c2baace..6870aa1456 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -601,7 +601,6 @@ pop3_connect (CamelService *service, CamelException *ex) return FALSE; do { - camel_exception_clear (ex); status = pop3_try_authenticate (service, reprompt, errbuf, ex); g_free (errbuf); errbuf = NULL; @@ -612,6 +611,7 @@ pop3_connect (CamelService *service, CamelException *ex) g_free (service->url->passwd); service->url->passwd = NULL; reprompt = TRUE; + camel_exception_clear (ex); } } while (status != -1 && ex->id == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE); |