|
|
6bbc61 |
diff -up evolution-data-server-3.8.5/camel/camel-imapx-job.c.detect-list-errors evolution-data-server-3.8.5/camel/camel-imapx-job.c
|
|
|
6bbc61 |
--- evolution-data-server-3.8.5/camel/camel-imapx-job.c.detect-list-errors 2013-07-23 07:57:42.000000000 -0400
|
|
|
6bbc61 |
+++ evolution-data-server-3.8.5/camel/camel-imapx-job.c 2013-12-19 13:42:15.923968414 -0500
|
|
|
6bbc61 |
@@ -29,6 +29,7 @@ struct _CamelIMAPXRealJob {
|
|
|
6bbc61 |
volatile gint ref_count;
|
|
|
6bbc61 |
|
|
|
6bbc61 |
GCancellable *cancellable;
|
|
|
6bbc61 |
+ GError *error;
|
|
|
6bbc61 |
|
|
|
6bbc61 |
/* Used for running some jobs synchronously. */
|
|
|
6bbc61 |
GCond done_cond;
|
|
|
6bbc61 |
@@ -113,6 +114,7 @@ camel_imapx_job_unref (CamelIMAPXJob *jo
|
|
|
6bbc61 |
|
|
|
6bbc61 |
g_cond_clear (&real_job->done_cond);
|
|
|
6bbc61 |
g_mutex_clear (&real_job->done_mutex);
|
|
|
6bbc61 |
+ g_clear_error (&real_job->error);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
if (real_job->destroy_data != NULL)
|
|
|
6bbc61 |
real_job->destroy_data (real_job->data);
|
|
|
6bbc61 |
@@ -221,7 +223,10 @@ camel_imapx_job_run (CamelIMAPXJob *job,
|
|
|
6bbc61 |
if (cancel_id > 0)
|
|
|
6bbc61 |
g_cancellable_disconnect (cancellable, cancel_id);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
- return success;
|
|
|
6bbc61 |
+ if (success && g_cancellable_set_error_if_cancelled (cancellable, error))
|
|
|
6bbc61 |
+ return FALSE;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ return success && !camel_imapx_job_propagate_error (job, error);
|
|
|
6bbc61 |
}
|
|
|
6bbc61 |
|
|
|
6bbc61 |
gboolean
|
|
|
6bbc61 |
@@ -348,3 +353,37 @@ camel_imapx_job_get_cancellable (CamelIM
|
|
|
6bbc61 |
|
|
|
6bbc61 |
return real_job->cancellable;
|
|
|
6bbc61 |
}
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+void
|
|
|
6bbc61 |
+camel_imapx_job_set_error (CamelIMAPXJob *job,
|
|
|
6bbc61 |
+ const GError *error)
|
|
|
6bbc61 |
+{
|
|
|
6bbc61 |
+ CamelIMAPXRealJob *real_job;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ g_return_if_fail (CAMEL_IS_IMAPX_JOB (job));
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ real_job = (CamelIMAPXRealJob *) job;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ /* do not overwrite errors, the first set is kept */
|
|
|
6bbc61 |
+ if (!real_job->error && error)
|
|
|
6bbc61 |
+ real_job->error = g_error_copy (error);
|
|
|
6bbc61 |
+}
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+gboolean
|
|
|
6bbc61 |
+camel_imapx_job_propagate_error (CamelIMAPXJob *job,
|
|
|
6bbc61 |
+ GError **error)
|
|
|
6bbc61 |
+{
|
|
|
6bbc61 |
+ CamelIMAPXRealJob *real_job;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ g_return_val_if_fail (CAMEL_IS_IMAPX_JOB (job), FALSE);
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ real_job = (CamelIMAPXRealJob *) job;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ if (!real_job->error)
|
|
|
6bbc61 |
+ return FALSE;
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ if (error)
|
|
|
6bbc61 |
+ g_propagate_error (error, g_error_copy (real_job->error));
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ return TRUE;
|
|
|
6bbc61 |
+}
|
|
|
6bbc61 |
diff -up evolution-data-server-3.8.5/camel/camel-imapx-job.h.detect-list-errors evolution-data-server-3.8.5/camel/camel-imapx-job.h
|
|
|
6bbc61 |
--- evolution-data-server-3.8.5/camel/camel-imapx-job.h.detect-list-errors 2013-07-23 07:57:56.000000000 -0400
|
|
|
6bbc61 |
+++ evolution-data-server-3.8.5/camel/camel-imapx-job.h 2013-12-19 13:42:15.923968414 -0500
|
|
|
6bbc61 |
@@ -81,6 +81,10 @@ CamelFolder * camel_imapx_job_ref_folder
|
|
|
6bbc61 |
void camel_imapx_job_set_folder (CamelIMAPXJob *job,
|
|
|
6bbc61 |
CamelFolder *folder);
|
|
|
6bbc61 |
GCancellable * camel_imapx_job_get_cancellable (CamelIMAPXJob *job);
|
|
|
6bbc61 |
+void camel_imapx_job_set_error (CamelIMAPXJob *job,
|
|
|
6bbc61 |
+ const GError *error);
|
|
|
6bbc61 |
+gboolean camel_imapx_job_propagate_error (CamelIMAPXJob *job,
|
|
|
6bbc61 |
+ GError **error);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
G_END_DECLS
|
|
|
6bbc61 |
|
|
|
6bbc61 |
diff -up evolution-data-server-3.8.5/camel/camel-imapx-server.c.detect-list-errors evolution-data-server-3.8.5/camel/camel-imapx-server.c
|
|
|
6bbc61 |
--- evolution-data-server-3.8.5/camel/camel-imapx-server.c.detect-list-errors 2013-12-19 13:27:59.033552530 -0500
|
|
|
6bbc61 |
+++ evolution-data-server-3.8.5/camel/camel-imapx-server.c 2013-12-19 13:42:15.925968140 -0500
|
|
|
6bbc61 |
@@ -2772,6 +2772,7 @@ imapx_completion (CamelIMAPXServer *is,
|
|
|
6bbc61 |
CamelIMAPXCommand *ic;
|
|
|
6bbc61 |
gboolean success;
|
|
|
6bbc61 |
guint tag;
|
|
|
6bbc61 |
+ GError *local_error = NULL;
|
|
|
6bbc61 |
|
|
|
6bbc61 |
/* Given "A0001 ...", 'A' = tag prefix, '0001' = tag. */
|
|
|
6bbc61 |
|
|
|
6bbc61 |
@@ -2829,18 +2830,40 @@ imapx_completion (CamelIMAPXServer *is,
|
|
|
6bbc61 |
return FALSE;
|
|
|
6bbc61 |
}
|
|
|
6bbc61 |
|
|
|
6bbc61 |
+ camel_imapx_command_ref (ic);
|
|
|
6bbc61 |
camel_imapx_command_queue_remove (is->done, ic);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
QUEUE_UNLOCK (is);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
- ic->status = imapx_parse_status (stream, cancellable, error);
|
|
|
6bbc61 |
+ ic->status = imapx_parse_status (stream, cancellable, &local_error);
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ if (ic->status == NULL || local_error) {
|
|
|
6bbc61 |
+ if (!local_error)
|
|
|
6bbc61 |
+ local_error = g_error_new_literal (CAMEL_IMAPX_ERROR, 1, "command parse status failed without error set");
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ camel_imapx_job_set_error (camel_imapx_command_get_job (ic), local_error);
|
|
|
6bbc61 |
+ g_propagate_error (error, local_error);
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ camel_imapx_command_unref (ic);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
- if (ic->status == NULL)
|
|
|
6bbc61 |
return FALSE;
|
|
|
6bbc61 |
+ }
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ if (ic->complete != NULL) {
|
|
|
6bbc61 |
+ if (!ic->complete (is, ic, cancellable, &local_error) || local_error) {
|
|
|
6bbc61 |
+ if (!local_error)
|
|
|
6bbc61 |
+ local_error = g_error_new_literal (CAMEL_IMAPX_ERROR, 1, "command complete failed without error set");
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ camel_imapx_job_set_error (camel_imapx_command_get_job (ic), local_error);
|
|
|
6bbc61 |
+ g_propagate_error (error, local_error);
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ camel_imapx_command_unref (ic);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
- if (ic->complete != NULL)
|
|
|
6bbc61 |
- if (!ic->complete (is, ic, cancellable, error))
|
|
|
6bbc61 |
return FALSE;
|
|
|
6bbc61 |
+ }
|
|
|
6bbc61 |
+ }
|
|
|
6bbc61 |
+
|
|
|
6bbc61 |
+ camel_imapx_command_unref (ic);
|
|
|
6bbc61 |
|
|
|
6bbc61 |
QUEUE_LOCK (is);
|
|
|
6bbc61 |
success = imapx_command_start_next (is, cancellable, error);
|
|
|
6bbc61 |
diff -up evolution-data-server-3.8.5/camel/camel-imapx-store.c.detect-list-errors evolution-data-server-3.8.5/camel/camel-imapx-store.c
|
|
|
6bbc61 |
--- evolution-data-server-3.8.5/camel/camel-imapx-store.c.detect-list-errors 2013-12-19 13:27:59.028552534 -0500
|
|
|
6bbc61 |
+++ evolution-data-server-3.8.5/camel/camel-imapx-store.c 2013-12-19 13:42:15.926968007 -0500
|
|
|
6bbc61 |
@@ -1011,11 +1011,15 @@ fetch_folders_for_pattern (CamelIMAPXSto
|
|
|
6bbc61 |
GError **error)
|
|
|
6bbc61 |
{
|
|
|
6bbc61 |
GPtrArray *folders;
|
|
|
6bbc61 |
+ GError *local_error = NULL;
|
|
|
6bbc61 |
|
|
|
6bbc61 |
folders = camel_imapx_server_list (
|
|
|
6bbc61 |
- server, pattern, flags, ext, cancellable, error);
|
|
|
6bbc61 |
- if (folders == NULL)
|
|
|
6bbc61 |
+ server, pattern, flags, ext, cancellable, &local_error);
|
|
|
6bbc61 |
+ if (folders == NULL || local_error) {
|
|
|
6bbc61 |
+ if (local_error)
|
|
|
6bbc61 |
+ g_propagate_error (error, local_error);
|
|
|
6bbc61 |
return FALSE;
|
|
|
6bbc61 |
+ }
|
|
|
6bbc61 |
|
|
|
6bbc61 |
add_folders_to_summary (istore, server, folders, table, (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED));
|
|
|
6bbc61 |
|