[evolution-ews/gnome-3-28] Bug 794815 - Forgive errors when fetching events
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews/gnome-3-28] Bug 794815 - Forgive errors when fetching events
- Date: Mon, 9 Apr 2018 08:52:17 +0000 (UTC)
commit c61a204a206fb4a03d4397a95182ab6e5203bb0c
Author: Milan Crha <mcrha redhat com>
Date: Mon Apr 9 10:54:03 2018 +0200
Bug 794815 - Forgive errors when fetching events
src/calendar/e-cal-backend-ews.c | 9 +++++++--
src/server/e-ews-item.c | 17 +++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index cd917af..be6b11b 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -519,7 +519,7 @@ ecb_ews_item_to_component_sync (ECalBackendEws *cbews,
if (!vcomp) {
if (mime_content)
- g_warn_if_reached ();
+ g_warning ("%s: Failed to parse mime content:---%s---", G_STRFUNC,
mime_content);
return NULL;
}
@@ -1050,9 +1050,14 @@ ecb_ews_get_items_sync (ECalBackendEws *cbews,
break;
} else {
ECalComponent *comp;
+ GError *local_error = NULL;
- comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, error);
+ comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, &local_error);
if (!comp) {
+ if (!local_error)
+ continue;
+
+ g_propagate_error (error, local_error);
success = FALSE;
break;
}
diff --git a/src/server/e-ews-item.c b/src/server/e-ews-item.c
index 4fbfed7..53b6c69 100644
--- a/src/server/e-ews-item.c
+++ b/src/server/e-ews-item.c
@@ -29,6 +29,8 @@
#include <glib/gstdio.h>
#include <glib/gprintf.h>
#include <libsoup/soup-misc.h>
+#include <libedataserver/libedataserver.h>
+
#include "e-ews-item.h"
#include "e-ews-item-change.h"
@@ -1028,6 +1030,7 @@ e_ews_item_set_from_soap_parameter (EEwsItem *item,
/* The order is maintained according to the order in soap response */
if (!g_ascii_strcasecmp (name, "MimeContent")) {
+ gchar *charset;
guchar *data;
gsize data_len = 0;
@@ -1038,6 +1041,20 @@ e_ews_item_set_from_soap_parameter (EEwsItem *item,
g_free (data);
return FALSE;
}
+
+ charset = e_soap_parameter_get_property (subparam, "CharacterSet");
+ if (g_strcmp0 (charset, "UTF-8") == 0 &&
+ !g_utf8_validate ((const gchar *) data, data_len, NULL)) {
+ gchar *tmp;
+
+ tmp = e_util_utf8_data_make_valid ((const gchar *) data, data_len);
+ if (tmp) {
+ g_free (data);
+ data = (guchar *) tmp;
+ }
+ }
+ g_free (charset);
+
priv->mime_content = (gchar *) data;
g_free (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]