+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.
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);
}
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);
{
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;
}
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)
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
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();
}
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
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;
}
new_uids = g_ptr_array_new ();
cache->level++;
-
+
for (i = 0; i < uids->len; i++) {
struct _uid_state *state;
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;
state = g_new (struct _uid_state, 1);
state->save = TRUE;
state->level = cache->level;
-
+
g_hash_table_insert (cache->uids, g_strdup (uid), state);
}
}
}
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) {*/
return FALSE;
do {
- camel_exception_clear (ex);
status = pop3_try_authenticate (service, reprompt, errbuf, ex);
g_free (errbuf);
errbuf = NULL;
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);