import evolution-data-server-3.28.5-13.el8

This commit is contained in:
CentOS Sources 2020-04-23 22:08:54 +00:00 committed by Andrew Lukoshko
commit 44f05b8564
13 changed files with 3201 additions and 0 deletions

View File

@ -0,0 +1 @@
85025da5aeda52b9bb9506cb89c7985d1cb9083c SOURCES/evolution-data-server-3.28.5.tar.xz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
SOURCES/evolution-data-server-3.28.5.tar.xz

View File

@ -0,0 +1,18 @@
diff -up evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c.cve-2019-3890 evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c
--- evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c.cve-2019-3890 2019-04-15 09:25:49.273786456 +0200
+++ evolution-data-server-3.28.5/src/libedataserver/e-data-server-util.c 2019-04-15 09:35:00.784778830 +0200
@@ -3147,11 +3147,13 @@ e_util_can_use_collection_as_credential_
if (can_use_collection) {
gchar *method_source, *method_collection;
- /* Also check the method; if different, then rather not use the collection */
+ /* Also check the method; if different, then rather not use the collection.
+ Consider 'none' method on the child as the same as the collection method. */
method_source = e_source_authentication_dup_method (auth_source);
method_collection = e_source_authentication_dup_method (auth_collection);
can_use_collection = !method_source || !method_collection ||
+ g_ascii_strcasecmp (method_source, "none") == 0 ||
g_ascii_strcasecmp (method_source, method_collection) == 0;
g_free (method_source);

View File

@ -0,0 +1,24 @@
diff -up evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-online-load-href evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c
--- evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-online-load-href 2018-11-26 12:18:57.874823757 +0100
+++ evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c 2018-11-26 12:20:27.967822511 +0100
@@ -993,6 +993,8 @@ ebb_webdav_load_contact_sync (EBookMetaB
if (!*out_contact) {
success = FALSE;
g_propagate_error (&local_error, EDB_ERROR_EX (E_DATA_BOOK_STATUS_OTHER_ERROR, _("Received object is not a valid vCard")));
+ } else if (out_extra) {
+ *out_extra = g_strdup (href);
}
}
diff -up evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-online-load-href evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c
--- evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-online-load-href 2018-11-26 12:19:15.809823509 +0100
+++ evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c 2018-11-26 12:20:03.976822843 +0100
@@ -1135,6 +1135,8 @@ ecb_caldav_load_component_sync (ECalMeta
if (!*out_component) {
success = FALSE;
g_propagate_error (&local_error, EDC_ERROR (InvalidObject));
+ } else if (out_extra) {
+ *out_extra = g_strdup (href);
}
}

View File

@ -0,0 +1,34 @@
diff -up evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-remove-ignores-not-found evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c
--- evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c.dav-remove-ignores-not-found 2018-11-28 14:31:11.278711852 +0100
+++ evolution-data-server-3.28.5/src/addressbook/backends/webdav/e-book-backend-webdav.c 2018-11-28 14:32:38.231710649 +0100
@@ -1160,6 +1160,13 @@ ebb_webdav_remove_contact_sync (EBookMet
g_object_unref (contact);
g_free (etag);
+ /* Ignore not found errors, this was a delete and the resource is gone.
+ It can be that it had been deleted on the server by other application. */
+ if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_NOT_FOUND)) {
+ g_clear_error (&local_error);
+ success = TRUE;
+ }
+
if (local_error) {
ebb_webdav_check_credentials_error (bbdav, webdav, local_error);
g_propagate_error (error, local_error);
diff -up evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-remove-ignores-not-found evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c
--- evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c.dav-remove-ignores-not-found 2018-11-28 14:30:52.299712114 +0100
+++ evolution-data-server-3.28.5/src/calendar/backends/caldav/e-cal-backend-caldav.c 2018-11-28 14:31:11.279711852 +0100
@@ -1320,6 +1320,13 @@ ecb_caldav_remove_component_sync (ECalMe
icalcomponent_free (icalcomp);
g_free (etag);
+ /* Ignore not found errors, this was a delete and the resource is gone.
+ It can be that it had been deleted on the server by other application. */
+ if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_NOT_FOUND)) {
+ g_clear_error (&local_error);
+ success = TRUE;
+ }
+
if (local_error) {
ecb_caldav_check_credentials_error (cbdav, webdav, local_error);
g_propagate_error (error, local_error);

View File

@ -0,0 +1,125 @@
diff -up evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c
--- evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c 2020-01-15 13:29:46.090644022 +0100
@@ -75,6 +75,78 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (
EDBusServer, e_dbus_server, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
+typedef struct _ModuleLoadData {
+ GWeakRef server_wr;
+ gchar *filename;
+} ModuleLoadData;
+
+static ModuleLoadData *
+module_load_data_new (EDBusServer *server,
+ const gchar *filename)
+{
+ ModuleLoadData *mld;
+
+ mld = g_slice_new0 (ModuleLoadData);
+ g_weak_ref_init (&mld->server_wr, server);
+ mld->filename = g_strdup (filename);
+
+ return mld;
+}
+
+static void
+module_load_data_free (gpointer ptr)
+{
+ ModuleLoadData *mld = ptr;
+
+ if (mld) {
+ g_weak_ref_clear (&mld->server_wr);
+ g_free (mld->filename);
+ g_slice_free (ModuleLoadData, mld);
+ }
+}
+
+static gboolean
+e_dbus_server_load_module_timeout_cb (gpointer user_data)
+{
+ ModuleLoadData *mld = user_data;
+ EDBusServer *server;
+
+ g_return_val_if_fail (mld != NULL, FALSE);
+
+ server = g_weak_ref_get (&mld->server_wr);
+ if (server) {
+ EModule *module;
+
+ e_source_registry_debug_print ("Loading module '%s'\n", mld->filename);
+
+ module = e_module_load_file (mld->filename);
+ if (module) {
+ g_type_module_unuse ((GTypeModule *) module);
+
+ e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
+ }
+
+ g_object_unref (server);
+ }
+
+ return FALSE;
+}
+
+static void
+e_dbus_server_schedule_module_load (EDBusServer *server,
+ const gchar *filename)
+{
+ g_return_if_fail (E_IS_DBUS_SERVER (server));
+ g_return_if_fail (filename != NULL);
+
+ e_source_registry_debug_print ("Schedule load of module '%s'\n", filename);
+
+ /* Delay the load by 10 seconds, in case the module doesn't have placed
+ all its libraries in the expected directories. */
+ g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 10, e_dbus_server_load_module_timeout_cb,
+ module_load_data_new (server, filename), module_load_data_free);
+}
+
static void
dbus_server_bus_acquired_cb (GDBusConnection *connection,
const gchar *bus_name,
@@ -552,38 +624,27 @@ dbus_server_module_directory_changed_cb
if (event_type == G_FILE_MONITOR_EVENT_RENAMED && other_file) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
+ gchar *other_filename = g_file_get_path (other_file);
+ e_source_registry_debug_print ("Module file '%s' renamed to '%s'\n", filename, other_filename);
g_free (filename);
- filename = g_file_get_path (other_file);
+ filename = other_filename;
event_type = G_FILE_MONITOR_EVENT_CREATED;
}
G_UNLOCK (loaded_modules);
}
if (filename && g_str_has_suffix (filename, "." G_MODULE_SUFFIX)) {
- gboolean any_loaded = FALSE;
-
if (event_type == G_FILE_MONITOR_EVENT_CREATED ||
event_type == G_FILE_MONITOR_EVENT_MOVED_IN) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
- EModule *module;
-
g_hash_table_add (loaded_modules, g_strdup (filename));
-
- module = e_module_load_file (filename);
- if (module) {
- any_loaded = TRUE;
-
- g_type_module_unuse ((GTypeModule *) module);
- }
+ e_dbus_server_schedule_module_load (server, filename);
}
G_UNLOCK (loaded_modules);
}
-
- if (any_loaded)
- e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
}
g_free (filename);

View File

@ -0,0 +1,55 @@
From 6022b2b7816fea84919eef5993363f636bf734dc Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Mon, 3 Sep 2018 09:43:50 +0200
Subject: evo-I#86 - Quoting of plain text mail into HTML mode mangles deeper
levels
Related to https://gitlab.gnome.org/GNOME/evolution/issues/86
diff --git a/src/camel/camel-mime-filter-tohtml.c b/src/camel/camel-mime-filter-tohtml.c
index 07024aa1a..df6283655 100644
--- a/src/camel/camel-mime-filter-tohtml.c
+++ b/src/camel/camel-mime-filter-tohtml.c
@@ -303,6 +303,7 @@ html_convert (CamelMimeFilter *mime_filter,
outend = mime_filter->outbuf + mime_filter->outsize;
if (priv->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !priv->pre_open) {
+ outptr = check_size (mime_filter, outptr, &outend, 6);
outptr = g_stpcpy (outptr, "<pre>");
priv->pre_open = TRUE;
}
@@ -339,13 +340,13 @@ html_convert (CamelMimeFilter *mime_filter,
depth = citation_depth (start, inend, &skip);
while (priv->blockquote_depth < depth) {
- outptr = check_size (mime_filter, outptr, &outend, 30);
- outptr = g_stpcpy (outptr, "<blockquote type=\"cite\">\n");
+ outptr = check_size (mime_filter, outptr, &outend, 25);
+ outptr = g_stpcpy (outptr, "<blockquote type=\"cite\">");
priv->blockquote_depth++;
}
while (priv->blockquote_depth > depth) {
- outptr = check_size (mime_filter, outptr, &outend, 15);
- outptr = g_stpcpy (outptr, "</blockquote>\n");
+ outptr = check_size (mime_filter, outptr, &outend, 14);
+ outptr = g_stpcpy (outptr, "</blockquote>");
priv->blockquote_depth--;
}
#if FOOLISHLY_UNMUNGE_FROM
@@ -463,14 +464,14 @@ html_convert (CamelMimeFilter *mime_filter,
outptr, &outend);
while (priv->blockquote_depth > 0) {
- outptr = check_size (mime_filter, outptr, &outend, 15);
+ outptr = check_size (mime_filter, outptr, &outend, 14);
outptr = g_stpcpy (outptr, "</blockquote>");
priv->blockquote_depth--;
}
if (priv->pre_open) {
/* close the pre-tag */
- outptr = check_size (mime_filter, outptr, &outend, 10);
+ outptr = check_size (mime_filter, outptr, &outend, 7);
outptr = g_stpcpy (outptr, "</pre>");
priv->pre_open = FALSE;
}

View File

@ -0,0 +1,117 @@
diff -up evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics
--- evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution 2020-01-16 08:28:52.842204524 +0100
+++ evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics 2020-01-16 08:30:30.726203170 +0100
@@ -6,7 +6,7 @@ DTEND;TZID=/freeassociation.sourceforge.
SEQUENCE:1
SUMMARY:With attachment
TRANSP:OPAQUE
-ATTACH:file:///usr/share/icons/hicolor/48x48/apps/evolution.png
+ATTACH:$EVENT1URI$
CLASS:PUBLIC
CREATED:20170221T125054Z
LAST-MODIFIED:20170221T125054Z
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c 2020-01-16 08:28:52.842204524 +0100
@@ -114,13 +114,10 @@ tcu_fixture_teardown (TCUFixture *fixtur
}
gchar *
-tcu_new_icalstring_from_test_case (const gchar *case_name)
+tcu_get_test_case_filename (const gchar *case_name)
{
gchar *filename;
gchar *case_filename;
- GFile * file;
- GError *error = NULL;
- gchar *icalstring = NULL;
case_filename = g_strdup_printf ("%s.ics", case_name);
@@ -132,16 +129,48 @@ tcu_new_icalstring_from_test_case (const
else
filename = g_build_filename (SRCDIR, "..", "libedata-cal", "components", case_filename, NULL);
+ g_free (case_filename);
+
+ return filename;
+}
+
+gchar *
+tcu_new_icalstring_from_test_case (const gchar *case_name)
+{
+ gchar *filename;
+ GFile * file;
+ GError *error = NULL;
+ gchar *icalstring = NULL, *uripart;
+
+ filename = tcu_get_test_case_filename (case_name);
+
file = g_file_new_for_path (filename);
if (!g_file_load_contents (file, NULL, &icalstring, NULL, NULL, &error))
g_error (
"Failed to read test iCal string file '%s': %s",
filename, error->message);
- g_free (case_filename);
g_free (filename);
g_object_unref (file);
+ uripart = strstr (icalstring, "$EVENT1URI$");
+ if (uripart) {
+ gchar *uri;
+ GString *str;
+
+ filename = tcu_get_test_case_filename ("event-1");
+ uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ str = g_string_new_len (icalstring, uripart - icalstring);
+ g_string_append (str, uri);
+ g_string_append (str, uripart + 11);
+ g_free (icalstring);
+ g_free (uri);
+
+ icalstring = g_string_free (str, FALSE);
+ }
+
return icalstring;
}
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h 2020-01-16 08:28:52.842204524 +0100
@@ -46,6 +46,7 @@ ECalComponent * tcu_new_component_from_t
void tcu_add_component_from_test_case (TCUFixture *fixture,
const gchar *case_name,
ECalComponent **out_component);
+gchar * tcu_get_test_case_filename (const gchar *case_name);
G_END_DECLS
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c 2020-01-16 08:28:52.842204524 +0100
@@ -1274,6 +1274,7 @@ static void
test_get_attachment_uris (ECalMetaBackend *meta_backend)
{
ECalBackendSyncClass *backend_class;
+ gchar *expected_uri, *filename;
GSList *uris = NULL;
GError *error = NULL;
@@ -1306,7 +1307,13 @@ test_get_attachment_uris (ECalMetaBacken
g_assert_no_error (error);
g_assert_nonnull (uris);
g_assert_cmpint (g_slist_length (uris), ==, 1);
- g_assert_cmpstr (uris->data, ==, "file:///usr/share/icons/hicolor/48x48/apps/evolution.png");
+
+ filename = tcu_get_test_case_filename ("event-1");
+ expected_uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ g_assert_cmpstr (uris->data, ==, expected_uri);
+ g_free (expected_uri);
g_slist_free_full (uris, g_free);
}

View File

@ -0,0 +1,100 @@
diff -up evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c
--- evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/addressbook/libedata-book/e-data-book.c 2019-05-23 19:31:07.484064234 +0200
@@ -1856,6 +1856,12 @@ e_data_book_report_backend_property_chan
g_strfreev (strv);
}
+ /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+ if (book->priv->connection && !g_dbus_connection_is_closed (book->priv->connection))
+ g_dbus_connection_flush_sync (book->priv->connection, NULL, NULL);
+
/* Disregard anything else. */
}
diff -up evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c
--- evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/calendar/libedata-cal/e-data-cal.c 2019-05-23 19:31:07.485064234 +0200
@@ -2470,6 +2470,12 @@ e_data_cal_report_backend_property_chang
if (g_str_equal (prop_name, CAL_BACKEND_PROPERTY_DEFAULT_OBJECT))
e_dbus_calendar_set_default_object (dbus_interface, prop_value);
+ /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+ g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+ if (cal->priv->connection && !g_dbus_connection_is_closed (cal->priv->connection))
+ g_dbus_connection_flush_sync (cal->priv->connection, NULL, NULL);
+
/* Disregard anything else. */
}
diff -up evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c
--- evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libebook/client/test-book-client-get-revision.c 2019-05-23 19:31:07.485064234 +0200
@@ -48,9 +48,22 @@ get_revision_compare_cycle (EBookClient
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
g_error ("Error getting book revision: %s", error->message);
+ /* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
+ thus give it some time to be received and processed. */
+ if (g_strcmp0 (revision_before, revision_after) == 0) {
+ g_message (" D-Bus property 'revision' change not received yet, trying to wait a bit");
+
+ g_usleep (G_USEC_PER_SEC / 2);
+
+ g_clear_pointer (&revision_after, g_free);
+
+ if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
+ g_error ("Error getting book revision: %s", error->message);
+ }
+
g_assert (revision_before);
g_assert (revision_after);
- g_assert (strcmp (revision_before, revision_after) != 0);
+ g_assert_cmpstr (revision_before, !=, revision_after);
g_message (
"Passed cycle, revision before '%s' revision after '%s'",
diff -up evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c
--- evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c.test-cal-client-get-revision 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-revision.c 2019-05-23 19:31:07.485064234 +0200
@@ -42,18 +42,34 @@ get_revision_compare_cycle (ECalClient *
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_before, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting calendar revision: %s", error->message);
if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
g_error ("Error creating object: %s", error->message);
+ if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+ g_error ("Error removing created object: %s", error->message);
+
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_after, NULL, &error))
- g_error ("Error getting book revision: %s", error->message);
+ g_error ("Error getting calendar revision: %s", error->message);
+
+ /* Sometimes, kind of rarely, the D-Bus property change is not delivered on time,
+ thus give it some time to be received and processed. */
+ if (g_strcmp0 (revision_before, revision_after) == 0) {
+ g_message (" D-Bus property 'revision' change not received yet, trying to wait a bit");
+
+ g_usleep (G_USEC_PER_SEC / 2);
+
+ g_clear_pointer (&revision_after, g_free);
+
+ if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION, &revision_after, NULL, &error))
+ g_error ("Error getting book revision: %s", error->message);
+ }
g_assert (revision_before);
g_assert (revision_after);
- g_assert (strcmp (revision_before, revision_after) != 0);
+ g_assert_cmpstr (revision_before, !=, revision_after);
g_message (
"Passed cycle, revision before '%s' revision after '%s'",

View File

@ -0,0 +1,341 @@
diff -up evolution-data-server-3.28.5/src/libebackend/e-data-factory.c.tests-retry-client-open evolution-data-server-3.28.5/src/libebackend/e-data-factory.c
--- evolution-data-server-3.28.5/src/libebackend/e-data-factory.c.tests-retry-client-open 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libebackend/e-data-factory.c 2018-12-04 10:42:29.837599599 +0100
@@ -1278,6 +1278,13 @@ data_factory_spawn_subprocess_backend (E
priv = data_factory->priv;
source = e_source_registry_ref_source (priv->registry, uid);
+
+ if (!source) {
+ g_set_error (
+ &error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ _("No such source for UID “%s”"), uid);
+ }
+
if (source && e_source_has_extension (source, extension_name)) {
ESourceBackend *extension;
@@ -1372,7 +1379,7 @@ data_factory_spawn_subprocess_backend (E
NULL);
g_object_unref (subprocess);
- } else {
+ } else if (!error) {
error = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Backend factory for source “%s” and extension “%s” cannot be found."),
uid, extension_name);
diff -up evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c.tests-retry-client-open evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c
--- evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c.tests-retry-client-open 2018-12-04 10:43:10.449599037 +0100
+++ evolution-data-server-3.28.5/tests/libecal/client/test-cal-client-get-free-busy.c 2018-12-04 10:43:19.837598907 +0100
@@ -94,6 +94,49 @@ teardown_fixture (ETestServerFixture *fi
}
static void
+add_component_sync (ECalClient *cal_client)
+{
+ const gchar *comp_str =
+ "BEGIN:VEVENT\r\n"
+ "UID:test-fb-event-1\r\n"
+ "DTSTAMP:20040212T000000Z\r\n"
+ "DTSTART:20040213T060000Z\r\n"
+ "DTEND:20040213T080000Z\r\n"
+ "SUMMARY:Test event\r\n"
+ "TRANSP:OPAQUE\r\n"
+ "CLASS:PUBLIC\r\n"
+ "CREATED:20040211T080000Z\r\n"
+ "LAST-MODIFIED:20040211T080000Z\r\n"
+ "END:VEVENT\r\n";
+ icalcomponent *icalcomp;
+ GError *error = NULL;
+
+ icalcomp = icalcomponent_new_from_string (comp_str);
+ g_assert_nonnull (icalcomp);
+
+ if (!e_cal_client_create_object_sync (cal_client, icalcomp, NULL, NULL, &error))
+ g_error ("Failed to add component: %s", error ? error->message : "Unknown error");
+
+ icalcomponent_free (icalcomp);
+ g_clear_error (&error);
+}
+
+static void
+wait_for_dbus_signal (GMainLoop *loop)
+{
+ GMainContext *main_context;
+ gint retries = 0;
+
+ main_context = g_main_loop_get_context (loop);
+
+ while (!received_free_busy_data && retries < 5) {
+ retries++;
+
+ g_main_context_iteration (main_context, TRUE);
+ }
+}
+
+static void
free_busy_data_cb (ECalClient *client,
const GSList *free_busy,
const gchar *func_name)
@@ -114,9 +157,13 @@ test_get_free_busy_sync (ETestServerFixt
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
+ add_component_sync (cal_client);
+
/* This is set by the free-busy-data callback */
received_free_busy_data = FALSE;
+ g_signal_connect (cal_client, "free-busy-data", G_CALLBACK (free_busy_data_cb), (gpointer) G_STRFUNC);
+
utc = icaltimezone_get_utc_timezone ();
start = time_from_isodate ("20040212T000000Z");
end = time_add_day_with_zone (start, 2, utc);
@@ -127,6 +174,9 @@ test_get_free_busy_sync (ETestServerFixt
g_slist_free (users);
+ wait_for_dbus_signal (fixture->loop);
+
+ g_assert (received_free_busy_data);
g_assert (freebusy_data);
g_slist_free_full (freebusy_data, g_object_unref);
@@ -147,6 +197,8 @@ async_get_free_busy_result_ready (GObjec
if (!e_cal_client_get_free_busy_finish (cal_client, result, &freebusy_data, &error))
g_error ("create object finish: %s", error->message);
+ wait_for_dbus_signal (loop);
+
g_assert (received_free_busy_data);
g_assert (freebusy_data);
@@ -166,6 +218,8 @@ test_get_free_busy_async (ETestServerFix
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
+ add_component_sync (cal_client);
+
/* This is set by the free-busy-data callback */
received_free_busy_data = FALSE;
diff -up evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c.tests-retry-client-open evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c
--- evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c.tests-retry-client-open 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/test-server-utils/e-test-server-utils.c 2018-12-04 10:43:19.838598907 +0100
@@ -199,6 +199,7 @@ assert_object_finalized (ETestServerFixt
typedef struct {
ETestServerFixture *fixture;
ETestServerClosure *closure;
+ guint retries;
} FixturePair;
static gboolean
@@ -332,12 +333,15 @@ e_test_server_utils_bootstrap_timeout (F
return FALSE;
}
+static gboolean e_test_server_utils_retry_open_client_cb (gpointer user_data);
+
static void
e_test_server_utils_client_ready (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
FixturePair *pair = (FixturePair *) user_data;
+ gboolean need_retry = FALSE;
GError *error = NULL;
switch (pair->closure->type) {
@@ -345,7 +349,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.book_client = (EBookClient *)
e_book_client_connect_finish (res, &error);
- if (!pair->fixture->service.book_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
break;
@@ -353,7 +360,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.book_client = (EBookClient *)
e_book_client_connect_direct_finish (res, &error);
- if (!pair->fixture->service.book_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
break;
@@ -361,7 +371,10 @@ e_test_server_utils_client_ready (GObjec
pair->fixture->service.calendar_client = (ECalClient *)
e_cal_client_connect_finish (res, &error);
- if (!pair->fixture->service.calendar_client)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else if (!pair->fixture->service.calendar_client)
g_error ("Unable to create the test calendar: %s", error->message);
break;
@@ -371,6 +384,14 @@ e_test_server_utils_client_ready (GObjec
g_assert_not_reached ();
}
+ g_clear_error (&error);
+
+ if (need_retry) {
+ pair->retries++;
+ g_timeout_add_seconds (1, e_test_server_utils_retry_open_client_cb, pair);
+ return;
+ }
+
/* Track ref counts now that we have a client */
add_weak_ref (pair->fixture, pair->closure->type);
@@ -382,6 +403,7 @@ e_test_server_utils_source_added (ESourc
ESource *source,
FixturePair *pair)
{
+ gboolean need_retry = FALSE;
GError *error = NULL;
if (g_strcmp0 (e_source_get_uid (source), pair->fixture->source_name) != 0)
@@ -409,8 +431,13 @@ e_test_server_utils_source_added (ESourc
}
if (!pair->closure->use_async_connect &&
- !pair->fixture->service.book_client)
- g_error ("Unable to create the test book: %s", error ? error->message : "Unknown error");
+ !pair->fixture->service.book_client) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test book: %s", error ? error->message : "Unknown error");
+ }
break;
@@ -418,11 +445,23 @@ e_test_server_utils_source_added (ESourc
/* Dont bother testing the Async apis for deprecated APIs */
pair->fixture->service.book = e_book_new (source, &error);
- if (!pair->fixture->service.book)
- g_error ("Unable to create the test book: %s", error->message);
+ if (!pair->fixture->service.book) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test book: %s", error->message);
+
+ break;
+ }
- if (!e_book_open (pair->fixture->service.book, FALSE, &error))
- g_error ("Unable to open book: %s", error->message);
+ if (!e_book_open (pair->fixture->service.book, FALSE, &error)) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to open book: %s", error->message);
+ }
break;
@@ -439,8 +478,13 @@ e_test_server_utils_source_added (ESourc
e_cal_client_connect_sync (
source,
pair->closure->calendar_source_type, (guint32) -1, NULL, &error);
- if (!pair->fixture->service.calendar_client)
- g_error ("Unable to create the test calendar: %s", error->message);
+ if (!pair->fixture->service.calendar_client) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test calendar: %s", error->message);
+ }
}
break;
@@ -449,11 +493,22 @@ e_test_server_utils_source_added (ESourc
/* Dont bother testing the Async apis for deprecated APIs */
pair->fixture->service.calendar = e_cal_new (source, pair->closure->calendar_source_type);
- if (!pair->fixture->service.calendar)
- g_error ("Unable to create the test calendar");
+ if (!pair->fixture->service.calendar) {
+ if (pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to create the test calendar");
- if (!e_cal_open (pair->fixture->service.calendar, FALSE, &error))
- g_error ("Unable to open calendar: %s", error->message);
+ break;
+ }
+
+ if (!e_cal_open (pair->fixture->service.calendar, FALSE, &error)) {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
+ pair->retries < 3)
+ need_retry = TRUE;
+ else
+ g_error ("Unable to open calendar: %s", error->message);
+ }
break;
@@ -461,6 +516,14 @@ e_test_server_utils_source_added (ESourc
return;
}
+ g_clear_error (&error);
+
+ if (need_retry) {
+ pair->retries++;
+ g_timeout_add_seconds (1, e_test_server_utils_retry_open_client_cb, pair);
+ return;
+ }
+
/* Add the weak ref now if we just created it */
if (pair->closure->type != E_TEST_SERVER_NONE &&
pair->closure->use_async_connect == FALSE)
@@ -471,6 +534,22 @@ e_test_server_utils_source_added (ESourc
}
static gboolean
+e_test_server_utils_retry_open_client_cb (gpointer user_data)
+{
+ FixturePair *pair = user_data;
+ ESource *source;
+
+ source = e_source_registry_ref_source (pair->fixture->registry, pair->fixture->source_name);
+
+ g_assert (E_IS_SOURCE (source));
+
+ e_test_server_utils_source_added (pair->fixture->registry, source, pair);
+ g_object_unref (source);
+
+ return FALSE;
+}
+
+static gboolean
e_test_server_utils_bootstrap_idle (FixturePair *pair)
{
ESourceBackend *backend = NULL;
@@ -578,7 +657,7 @@ e_test_server_utils_setup (ETestServerFi
gconstpointer user_data)
{
ETestServerClosure *closure = (ETestServerClosure *) user_data;
- FixturePair pair = { fixture, closure };
+ FixturePair pair = { fixture, closure, 0 };
/* Create work directory */
if (!test_installed_services ())

View File

@ -0,0 +1,179 @@
diff --git a/src/addressbook/libebook-contacts/e-vcard.c b/src/addressbook/libebook-contacts/e-vcard.c
index e44b7fdcf..680cf85af 100644
--- a/src/addressbook/libebook-contacts/e-vcard.c
+++ b/src/addressbook/libebook-contacts/e-vcard.c
@@ -120,6 +120,14 @@
G_DEFINE_TYPE (EVCard, e_vcard, G_TYPE_OBJECT)
+static EVCardAttribute *e_vcard_attribute_ref (EVCardAttribute *attr);
+static void e_vcard_attribute_unref (EVCardAttribute *attr);
+static EVCardAttributeParam *e_vcard_attribute_param_ref (EVCardAttributeParam *param);
+static void e_vcard_attribute_param_unref (EVCardAttributeParam *param);
+
+G_DEFINE_BOXED_TYPE (EVCardAttribute, e_vcard_attribute, e_vcard_attribute_ref, e_vcard_attribute_unref)
+G_DEFINE_BOXED_TYPE (EVCardAttributeParam, e_vcard_attribute_param, e_vcard_attribute_param_ref, e_vcard_attribute_param_unref)
+
/* Encoding used in v-card
* Note: v-card spec defines additional 7BIT 8BIT and X- encoding
*/
@@ -135,6 +143,7 @@ struct _EVCardPrivate {
};
struct _EVCardAttribute {
+ gint ref_count;
gchar *group;
gchar *name;
GList *params; /* EVCardParam */
@@ -145,6 +154,7 @@ struct _EVCardAttribute {
};
struct _EVCardAttributeParam {
+ gint ref_count;
gchar *name;
GList *values; /* GList of gchar *'s */
};
@@ -1555,6 +1565,7 @@ e_vcard_attribute_new (const gchar *attr_group,
if (attr_group != NULL && *attr_group == '\0')
attr_group = NULL;
+ attr->ref_count = 1;
attr->group = g_strdup (attr_group);
attr->name = g_strdup (attr_name);
@@ -1572,14 +1583,34 @@ e_vcard_attribute_free (EVCardAttribute *attr)
{
g_return_if_fail (attr != NULL);
- g_free (attr->group);
- g_free (attr->name);
+ e_vcard_attribute_unref (attr);
+}
- e_vcard_attribute_remove_values (attr);
+static EVCardAttribute *
+e_vcard_attribute_ref (EVCardAttribute *attr)
+{
+ g_return_val_if_fail (attr != NULL, NULL);
- e_vcard_attribute_remove_params (attr);
+ g_atomic_int_inc (&attr->ref_count);
- g_slice_free (EVCardAttribute, attr);
+ return attr;
+}
+
+static void
+e_vcard_attribute_unref (EVCardAttribute *attr)
+{
+ g_return_if_fail (attr != NULL);
+
+ if (g_atomic_int_dec_and_test (&attr->ref_count)) {
+ g_free (attr->group);
+ g_free (attr->name);
+
+ e_vcard_attribute_remove_values (attr);
+
+ e_vcard_attribute_remove_params (attr);
+
+ g_slice_free (EVCardAttribute, attr);
+ }
}
/**
@@ -1609,25 +1640,6 @@ e_vcard_attribute_copy (EVCardAttribute *attr)
return a;
}
-GType
-e_vcard_attribute_get_type (void)
-{
- static volatile gsize type_id__volatile = 0;
-
- if (g_once_init_enter (&type_id__volatile)) {
- GType type_id;
-
- type_id = g_boxed_type_register_static (
- "EVCardAttribute",
- (GBoxedCopyFunc) e_vcard_attribute_copy,
- (GBoxedFreeFunc) e_vcard_attribute_free);
-
- g_once_init_leave (&type_id__volatile, type_id);
- }
-
- return type_id__volatile;
-}
-
/**
* e_vcard_remove_attributes:
* @evc: vcard object
@@ -2068,25 +2080,6 @@ e_vcard_attribute_remove_params (EVCardAttribute *attr)
attr->encoding = EVC_ENCODING_RAW;
}
-GType
-e_vcard_attribute_param_get_type (void)
-{
- static volatile gsize type_id__volatile = 0;
-
- if (g_once_init_enter (&type_id__volatile)) {
- GType type_id;
-
- type_id = g_boxed_type_register_static (
- "EVCardAttributeParam",
- (GBoxedCopyFunc) e_vcard_attribute_param_copy,
- (GBoxedFreeFunc) e_vcard_attribute_param_free);
-
- g_once_init_leave (&type_id__volatile, type_id);
- }
-
- return type_id__volatile;
-}
-
/**
* e_vcard_attribute_param_new:
* @name: the name of the new parameter
@@ -2099,6 +2092,8 @@ EVCardAttributeParam *
e_vcard_attribute_param_new (const gchar *name)
{
EVCardAttributeParam *param = g_slice_new (EVCardAttributeParam);
+
+ param->ref_count = 1;
param->values = NULL;
param->name = g_strdup (name);
@@ -2116,11 +2111,31 @@ e_vcard_attribute_param_free (EVCardAttributeParam *param)
{
g_return_if_fail (param != NULL);
- g_free (param->name);
+ e_vcard_attribute_param_unref (param);
+}
+
+static EVCardAttributeParam *
+e_vcard_attribute_param_ref (EVCardAttributeParam *param)
+{
+ g_return_val_if_fail (param != NULL, NULL);
+
+ g_atomic_int_inc (&param->ref_count);
+
+ return param;
+}
+
+static void
+e_vcard_attribute_param_unref (EVCardAttributeParam *param)
+{
+ g_return_if_fail (param != NULL);
+
+ if (g_atomic_int_dec_and_test (&param->ref_count)) {
+ g_free (param->name);
- e_vcard_attribute_param_remove_values (param);
+ e_vcard_attribute_param_remove_values (param);
- g_slice_free (EVCardAttributeParam, param);
+ g_slice_free (EVCardAttributeParam, param);
+ }
}
/**

View File

@ -0,0 +1,14 @@
diff --git a/src/addressbook/libebook-contacts/e-vcard.c b/src/addressbook/libebook-contacts/e-vcard.c
index f11a17d77..e44b7fdcf 100644
--- a/src/addressbook/libebook-contacts/e-vcard.c
+++ b/src/addressbook/libebook-contacts/e-vcard.c
@@ -2395,8 +2395,8 @@ e_vcard_attribute_remove_param_value (EVCardAttribute *attr,
return;
}
- param->values = g_list_delete_link (param->values, l);
g_free (l->data);
+ param->values = g_list_delete_link (param->values, l);
if (param->values == NULL) {
e_vcard_attribute_param_free (param);

File diff suppressed because it is too large Load Diff