[evolution-kolab/EDS_IMAPX_nobuild-3-4] updated IMAPX files as of EDS commit EVOLUTION_DATA_SERVER_3_4_3



commit 7e15b5a18cbf86619d6c2aca93877d6161ffd7ea
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Jun 18 10:43:10 2012 +0200

    updated IMAPX files as of EDS commit EVOLUTION_DATA_SERVER_3_4_3
    
    * updated the local IMAPX code from upstream
    * now at EDS commit
      967212df27ac7cd03f79c237b693200b9df4ef58

 .../providers/imapx/camel-imapx-conn-manager.c     |   22 ++++++++++++++++++-
 src/camel/providers/imapx/camel-imapx-server.c     |    6 +---
 2 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-conn-manager.c b/src/camel/providers/imapx/camel-imapx-conn-manager.c
index 1b87384..89d1af5 100644
--- a/src/camel/providers/imapx/camel-imapx-conn-manager.c
+++ b/src/camel/providers/imapx/camel-imapx-conn-manager.c
@@ -67,6 +67,13 @@ G_DEFINE_TYPE (
 	camel_imapx_conn_manager,
 	CAMEL_TYPE_OBJECT)
 
+static void
+imapx_conn_shutdown (CamelIMAPXServer *is, CamelIMAPXConnManager *con_man);
+
+static void
+imapx_conn_update_select (CamelIMAPXServer *is, const gchar *selected_folder,
+                          CamelIMAPXConnManager *con_man);
+
 static ConnectionInfo *
 connection_info_new (CamelIMAPXServer *is)
 {
@@ -107,7 +114,6 @@ connection_info_unref (ConnectionInfo *cinfo)
 
 	if (g_atomic_int_dec_and_test (&cinfo->ref_count)) {
 		camel_imapx_server_connect (cinfo->is, NULL, NULL);
-
 		g_mutex_free (cinfo->lock);
 		g_object_unref (cinfo->is);
 		g_hash_table_destroy (cinfo->folder_names);
@@ -117,6 +123,18 @@ connection_info_unref (ConnectionInfo *cinfo)
 	}
 }
 
+static void
+connection_info_cancel_and_unref (ConnectionInfo *cinfo)
+{
+	g_return_if_fail (cinfo != NULL);
+	g_return_if_fail (cinfo->ref_count > 0);
+	
+	g_signal_handlers_disconnect_matched (cinfo->is, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, imapx_conn_shutdown, NULL);
+	g_signal_handlers_disconnect_matched (cinfo->is, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, imapx_conn_update_select, NULL);
+	g_cancellable_cancel (cinfo->is->cancellable);
+	connection_info_unref (cinfo);
+}
+
 static gboolean
 connection_info_is_available (ConnectionInfo *cinfo)
 {
@@ -721,7 +739,7 @@ camel_imapx_conn_manager_close_connections (CamelIMAPXConnManager *con_man)
 
 	g_list_free_full (
 		con_man->priv->connections,
-		(GDestroyNotify) connection_info_unref);
+		(GDestroyNotify) connection_info_cancel_and_unref);
 	con_man->priv->connections = NULL;
 
 	CON_WRITE_UNLOCK (con_man);
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index f4819ef..f3cfe44 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -3548,7 +3548,7 @@ imapx_command_append_message_done (CamelIMAPXServer *is,
 			_("Error appending message"));
 		success = FALSE;
 
-	} else if (ic->status->condition == IMAPX_APPENDUID) {
+	} else if (ic->status && ic->status->condition == IMAPX_APPENDUID) {
 		c(is->tagprefix, "Got appenduid %d %d\n", (gint)ic->status->u.appenduid.uidvalidity, (gint)ic->status->u.appenduid.uid);
 		if (ic->status->u.appenduid.uidvalidity == ifolder->uidvalidity_on_server) {
 			CamelFolderChangeInfo *changes;
@@ -5360,8 +5360,7 @@ imapx_parser_thread (gpointer d)
 
 		if (is->parser_quit)
 			g_cancellable_cancel (cancellable);
-
-		if (g_cancellable_is_cancelled (cancellable)) {
+		else if (g_cancellable_is_cancelled (cancellable)) {
 			gint is_empty;
 
 			QUEUE_LOCK (is);
@@ -5399,7 +5398,6 @@ imapx_parser_thread (gpointer d)
 	QUEUE_UNLOCK (is);
 
 	is->parser_quit = FALSE;
-
 	g_signal_emit (is, signals[SHUTDOWN], 0);
 
 	return NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]