rpms/evolution-mapi/devel gnbug588453.patch, NONE, 1.1 gnbug595260.patch, NONE, 1.1 gnbug595355.patch, NONE, 1.1 gnbug595480.patch, NONE, 1.1 .cvsignore, 1.14, 1.15 evolution-mapi.spec, 1.18, 1.19 sources, 1.14, 1.15

Milan Crha mcrha at fedoraproject.org
Tue Sep 22 08:15:48 UTC 2009


Author: mcrha

Update of /cvs/pkgs/rpms/evolution-mapi/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14991

Modified Files:
	.cvsignore evolution-mapi.spec sources 
Added Files:
	gnbug588453.patch gnbug595260.patch gnbug595355.patch 
	gnbug595480.patch 
Log Message:
* Tue Sep 22 2009 Milan Crha <mcrha at redhat.com> - 0.28.0-1
- Update to 0.28.0
- Add patch for Gnome bug #588453 (slow retrieval of message IDs).
- Add patch for Gnome bug #595260 (crash in mapi_sync_deleted).
- Add patch for Gnome bug #595355 (crash and incorrect header parsing).
- Add patch for Gnome bug #595480 (crash on fetching GAL).



gnbug588453.patch:
 camel/camel-mapi-folder.c                  |    2 +-
 libexchangemapi/exchange-mapi-connection.c |   26 ++++++++++++++++----------
 libexchangemapi/exchange-mapi-connection.h |    3 ++-
 3 files changed, 19 insertions(+), 12 deletions(-)

--- NEW FILE gnbug588453.patch ---
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 63a15e9..df652b5 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -711,7 +711,7 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 					       prop_list, G_N_ELEMENTS (prop_list),
 					       NULL, NULL,
 					       deleted_items_sync_cb, &server_uid_list,
-					       options);
+					       options | MAPI_OPTIONS_DONT_OPEN_MESSAGE);
 
 	camel_operation_end (NULL);
 
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index 900d736..20341d0 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -1211,7 +1211,7 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 
 		for (i = 0; i < SRowSet.cRows; i++) {
 			mapi_object_t obj_message;
-			struct mapi_SPropValue_array properties_array;
+			struct mapi_SPropValue_array properties_array = {0};
 			const mapi_id_t *pfid;
 			const mapi_id_t	*pmid;
 			const bool *has_attach = NULL;
@@ -1227,6 +1227,9 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 
 			has_attach = (const bool *) get_SPropValue_SRow_data(&SRowSet.aRow[i], PR_HASATTACH);
 
+			if (options & MAPI_OPTIONS_DONT_OPEN_MESSAGE)
+				goto relax;
+				
 			retval = OpenMessage(&obj_folder, *pfid, *pmid, &obj_message, 0);
 			if (retval != MAPI_E_SUCCESS) {
 				mapi_errstr("OpenMessage", GetLastError());
@@ -1262,19 +1265,21 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 
 			} else
 				retval = GetPropsAll (&obj_message, &properties_array);
-
+ relax:
 			if (retval == MAPI_E_SUCCESS) {
 				FetchItemsCallbackData *item_data;
 				uint32_t z;
 
-				/* just to get all the other streams */
-				for (z=0; z < properties_array.cValues; z++) {
-					if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY && 
-					    (options & MAPI_OPTIONS_FETCH_GENERIC_STREAMS)) 
-					exchange_mapi_util_read_generic_stream (&obj_message, properties_array.lpProps[z].ulPropTag, &stream_list);
-				}
+				if ((options & MAPI_OPTIONS_DONT_OPEN_MESSAGE) == 0) {
+					/* just to get all the other streams */
+					for (z=0; z < properties_array.cValues; z++) {
+						if ((properties_array.lpProps[z].ulPropTag & 0xFFFF) == PT_BINARY && 
+						    (options & MAPI_OPTIONS_FETCH_GENERIC_STREAMS)) 
+						exchange_mapi_util_read_generic_stream (&obj_message, properties_array.lpProps[z].ulPropTag, &stream_list);
+					}
 
-				mapi_SPropValue_array_named(&obj_message, &properties_array);
+					mapi_SPropValue_array_named(&obj_message, &properties_array);
+				}
 
 				/* NOTE: stream_list, recipient_list and attach_list
 				   should be freed by the callback */
@@ -1297,7 +1302,8 @@ exchange_mapi_connection_fetch_items   (mapi_id_t fid,
 				talloc_free (properties_array.lpProps);
 
 		loop_cleanup:
-			mapi_object_release(&obj_message);
+			if ((options & MAPI_OPTIONS_DONT_OPEN_MESSAGE) == 0)
+				mapi_object_release (&obj_message);
 
 			if (!cb_retval) break;
 		}
diff --git a/src/libexchangemapi/exchange-mapi-connection.h b/src/libexchangemapi/exchange-mapi-connection.h
index 2059991..b2db6a8 100644
--- a/src/libexchangemapi/exchange-mapi-connection.h
+++ b/src/libexchangemapi/exchange-mapi-connection.h
@@ -37,7 +37,8 @@ typedef enum {
 	MAPI_OPTIONS_FETCH_GAL = 1 <<4,
 	MAPI_OPTIONS_DONT_SUBMIT = 1<<5, 
 	MAPI_OPTIONS_GETBESTBODY = 1<<6,
-	MAPI_OPTIONS_USE_PFSTORE = 1<<7
+	MAPI_OPTIONS_USE_PFSTORE = 1<<7,
+	MAPI_OPTIONS_DONT_OPEN_MESSAGE = 1<<8
 } ExchangeMAPIOptions;
 
 #define MAPI_OPTIONS_FETCH_ALL MAPI_OPTIONS_FETCH_ATTACHMENTS | \

gnbug595260.patch:
 camel-mapi-folder.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- NEW FILE gnbug595260.patch ---
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 43373fc..80bae7c 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -691,7 +691,6 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 	guint32 index, count, options = 0;
 	GSList *server_uid_list = NULL;
 	const gchar *uid = NULL;
-	GSList *tmp_list_item = NULL;
 
 	/* Currently we don't have simple wrapper over getprops.*/
 	const guint32 prop_list[] = { PR_LAST_MODIFICATION_TIME };
@@ -728,6 +727,8 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 
 	/* Iterate over cache and check if the UID is in server*/
 	for (index = 0; index < count; index++) {
+		GSList *tmp_list_item = NULL;
+
 		/*FIXME :Any other list available ???*/
 		info = camel_folder_summary_index (m->folder->summary, index);
 		if (!info) continue; /*This is bad. *Should* not happen*/
@@ -741,7 +742,7 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 		}
 
 		/* If it is not in server list, clean our cache */
-		if (!tmp_list_item->data && uid) {
+		if ((!tmp_list_item || !tmp_list_item->data) && uid) {
 			CAMEL_MAPI_FOLDER_REC_LOCK (m->folder, cache_lock);
 			camel_folder_summary_remove_uid (m->folder->summary, uid);
 			camel_data_cache_remove (mapi_folder->cache, "cache", uid, NULL);

gnbug595355.patch:
 camel-mapi-folder.c |   31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

--- NEW FILE gnbug595355.patch ---
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 63a15e9..be35310 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -1395,22 +1395,35 @@ mapi_populate_details_from_item (CamelFolder *folder, CamelMimeMessage *msg, Map
 	CamelInternetAddress *addr = NULL;
 	CamelMapiStore *mapi_store = CAMEL_MAPI_STORE(folder->parent_store);
 	int offset = 0;
-	guint i;
 	time_t actual_time;
 
 	/* Setting headers from PR_TRANSPORT_MESSAGE_HEADERS */
 	if (item->header.transport_headers) {
-		struct _camel_header_raw *headers;
-		gchar **header_list;
+		CamelMimePart *part = camel_mime_part_new ();
+		CamelStream *stream;
+		CamelMimeParser *parser;
 
-		header_list = g_strsplit (item->header.transport_headers, "\n", -1);
-		for (i = 0; header_list && header_list [i]; i++)
-			camel_header_raw_append_parse (&headers, header_list[i], -1);
+		stream = camel_stream_mem_new_with_buffer (item->header.transport_headers, strlen (item->header.transport_headers));
+		parser = camel_mime_parser_new ();
+		camel_mime_parser_init_with_stream (parser, stream);
+		camel_mime_parser_scan_from (parser, FALSE);
+		camel_object_unref (stream);
 
-		while (headers->next) {
-			camel_medium_add_header (CAMEL_MEDIUM (msg), headers->name, headers->value);
-			headers = headers->next ;
+		if (camel_mime_part_construct_from_parser (part, parser) != -1) {
+			struct _camel_header_raw *h;
+
+			for (h = part->headers; h; h = h->next) {
+				const gchar *value = h->value;
+
+				while (value && camel_mime_is_lwsp (*value))
+					value++;
+
+				camel_medium_add_header (CAMEL_MEDIUM (msg), h->name, value);
+			}
 		}
+
+		camel_object_unref (parser);
+		camel_object_unref (part);
 	}
 
 	/* Overwrite headers if we have specific properties available*/

gnbug595480.patch:
 exchange-mapi-connection.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- NEW FILE gnbug595480.patch ---
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index 900d736..ea40335 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -750,6 +750,8 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
 	
 	mem_ctx = talloc_init ("ExchangeMAPI_GetGAL");
 
+	LOCK ();
+
 	SPropTagArray = set_SPropTagArray(mem_ctx, 0xc,
 					  PR_INSTANCE_KEY,
 					  PR_ENTRYID,
@@ -770,7 +772,9 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
 		count += 0x2;
 		retval = GetGALTable(global_mapi_session, SPropTagArray, &SRowSet, count, ulFlags);
 		if ((!SRowSet) || (!(SRowSet->aRow))) {
-			return false;
+			UNLOCK ();
+			MAPIFreeBuffer (SPropTagArray);
+			return FALSE;
 		}
 		if (SRowSet->cRows) {
 			for (i = 0; i < SRowSet->cRows; i++) {
@@ -786,7 +790,9 @@ exchange_mapi_util_get_gal (GPtrArray *contacts_array)
 
 	MAPIFreeBuffer(SPropTagArray);
 
-	return true;
+	UNLOCK ();
+
+	return TRUE;
 	
 }
 
@@ -908,7 +914,9 @@ exchange_mapi_util_modify_recipients (TALLOC_CTX *mem_ctx, mapi_object_t *obj_me
 	}
 
 	/* Attempt to resolve names from the server */
+	LOCK ();
 	retval = ResolveNames (global_mapi_session, users, SPropTagArray, &SRowSet, &FlagList, 0);
+	UNLOCK ();
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("ResolveNames", GetLastError());
 		goto cleanup;


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/evolution-mapi/devel/.cvsignore,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- .cvsignore	7 Sep 2009 16:23:03 -0000	1.14
+++ .cvsignore	22 Sep 2009 08:15:39 -0000	1.15
@@ -1 +1 @@
-evolution-mapi-0.27.92.tar.bz2
+evolution-mapi-0.28.0.tar.bz2


Index: evolution-mapi.spec
===================================================================
RCS file: /cvs/pkgs/rpms/evolution-mapi/devel/evolution-mapi.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- evolution-mapi.spec	7 Sep 2009 16:23:03 -0000	1.18
+++ evolution-mapi.spec	22 Sep 2009 08:15:44 -0000	1.19
@@ -1,5 +1,5 @@
-%define evo_version 2.27.5
-%define eds_version 2.27.5
+%define evo_version 2.28.0
+%define eds_version 2.28.0
 %define libmapi_version 0.8
 %define intltool_version 0.35.5
 
@@ -11,7 +11,7 @@
 ### Abstract ###
 
 Name: evolution-mapi
-Version: 0.27.92
+Version: 0.28.0
 Release: 1%{?dist}
 Group: Applications/Productivity
 Summary: Evolution extension for MS Exchange 2007 servers
@@ -25,6 +25,13 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{na
 Requires: evolution >= %{evo_version}
 Requires: evolution-data-server >= %{eds_version}
 
+### Patches ###
+
+Patch1: gnbug588453.patch
+Patch2: gnbug595260.patch
+Patch3: gnbug595355.patch
+Patch4: gnbug595480.patch
+
 ### Build Dependencies ###
 
 BuildRequires: evolution-data-server-devel >= %{eds_version}
@@ -52,6 +59,11 @@ Development files needed for building th
 %prep
 %setup -q
 
+%patch1 -p1 -b .gnbug588453
+%patch2 -p1 -b .gnbug595260
+%patch3 -p1 -b .gnbug595355
+%patch4 -p1 -b .gnbug595480
+
 %build
 
 # Add stricter build settings here as the source code gets cleaned up.
@@ -108,6 +120,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/libexchangemapi-1.0.pc
 
 %changelog
+* Tue Sep 22 2009 Milan Crha <mcrha at redhat.com> - 0.28.0-1
+- Update to 0.28.0
+- Add patch for Gnome bug #588453 (slow retrieval of message IDs).
+- Add patch for Gnome bug #595260 (crash in mapi_sync_deleted).
+- Add patch for Gnome bug #595355 (crash and incorrect header parsing).
+- Add patch for Gnome bug #595480 (crash on fetching GAL).
+
 * Mon Sep 07 2009 Milan Crha <mcrha at redhat.com> - 0.27.92-1
 - Update to 0.27.92
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/evolution-mapi/devel/sources,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- sources	7 Sep 2009 16:23:03 -0000	1.14
+++ sources	22 Sep 2009 08:15:44 -0000	1.15
@@ -1 +1 @@
-7c8bc781e821e7243028f4488f951fb5  evolution-mapi-0.27.92.tar.bz2
+60a1a064d16a85497098b447637c6f3e  evolution-mapi-0.28.0.tar.bz2




More information about the scm-commits mailing list