[epiphany/wip/ephy-sync: 110/126] sync-bookmarks: Fix create_bso_collection_response_cb()
- From: Gabriel - Cristian Ivascu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/ephy-sync: 110/126] sync-bookmarks: Fix create_bso_collection_response_cb()
- Date: Fri, 19 Aug 2016 17:40:48 +0000 (UTC)
commit 7bf9fc9fd3a92e258c1250ac62be9a48173ecd52
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Mon Aug 8 21:15:00 2016 +0300
sync-bookmarks: Fix create_bso_collection_response_cb()
src/ephy-sync-bookmarks.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-sync-bookmarks.c b/src/ephy-sync-bookmarks.c
index 2c1c48e..8f6323f 100644
--- a/src/ephy-sync-bookmarks.c
+++ b/src/ephy-sync-bookmarks.c
@@ -62,6 +62,20 @@ get_storage_endpoint_for_bookmark (EphyBookmark *bookmark)
}
static void
+delete_dummy_bso_response_cb (SoupSession *session,
+ SoupMessage *message,
+ gpointer user_data)
+{
+ EphySyncService *service;
+
+ if (message->status_code != 200)
+ warning_alert ("Failed to delete the dummy BSO", message);
+
+ service = ephy_shell_get_global_sync_service (ephy_shell_get_default ());
+ ephy_sync_service_release_next_storage_message (service);
+}
+
+static void
create_bso_collection_response_cb (SoupSession *session,
SoupMessage *message,
gpointer user_data)
@@ -80,12 +94,14 @@ create_bso_collection_response_cb (SoupSession *session,
}
/* The EPHY_BOOKMARKS_COLLECTION collection is now created. We can safely
- * delete the dummy BSO that we've uploaded. No need to check for response.
+ * delete the dummy BSO that we've uploaded.
*/
endpoint = g_strdup_printf ("storage/%s/%s", EPHY_BOOKMARKS_COLLECTION, EPHY_BOOKMARKS_DUMMY_BSO);
ephy_sync_service_send_storage_message (service, endpoint, SOUP_METHOD_DELETE,
- NULL, -1, -1, NULL, NULL);
+ NULL, -1, -1,
+ delete_dummy_bso_response_cb, NULL);
g_free (endpoint);
+ ephy_sync_service_release_next_storage_message (service);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]