[epiphany/wip/ephy-sync: 86/86] sync-bookmarks: Add debug functions
- From: Gabriel - Cristian Ivascu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/ephy-sync: 86/86] sync-bookmarks: Add debug functions
- Date: Sat, 30 Jul 2016 17:37:17 +0000 (UTC)
commit 5279d73a115e5f8b70975b61ba7b135973801a49
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Sat Jul 30 20:12:03 2016 +0300
sync-bookmarks: Add debug functions
src/ephy-sync-bookmarks.c | 47 +++++++++++++++++++++++++++++++++++++++++++++
src/ephy-sync-bookmarks.h | 4 +++
2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-sync-bookmarks.c b/src/ephy-sync-bookmarks.c
index 62d5b1c..9344b72 100644
--- a/src/ephy-sync-bookmarks.c
+++ b/src/ephy-sync-bookmarks.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "ephy-sync-bookmarks.h"
+#include "ephy-debug.h"
#include "ephy-shell.h"
#include "ephy-sync-utils.h"
@@ -75,3 +76,49 @@ ephy_sync_bookmarks_create_storage_collection (void)
g_free (endpoint);
g_free (bso);
}
+
+static void
+server_response_default_cb (SoupSession *session,
+ SoupMessage *message,
+ gpointer user_data)
+{
+ LOG ("Server response:");
+ LOG ("status_code: %u", message->status_code);
+ LOG ("response_body: %s", message->response_body->data);
+ LOG ("Retry-After: %s", soup_message_headers_get_one (message->response_headers, "Retry-After"));
+ LOG ("X-Weave-Backoff: %s", soup_message_headers_get_one (message->response_headers, "X-Weave-Backoff"));
+ LOG ("X-Last-Modified: %s", soup_message_headers_get_one (message->response_headers, "X-Last-Modified"));
+ LOG ("X-Weave-Timestamp: %s", soup_message_headers_get_one (message->response_headers,
"X-Weave-Timestamp"));
+ LOG ("X-Weave-Records: %s", soup_message_headers_get_one (message->response_headers, "X-Weave-Records"));
+ LOG ("X-Weave-Next-Offset: %s", soup_message_headers_get_one (message->response_headers,
"X-Weave-Next-Offset"));
+ LOG ("X-Weave-Quota-Remaining: %s", soup_message_headers_get_one (message->response_headers,
"X-Weave-Quota-Remaining"));
+ LOG ("X-Weave-Alert: %s", soup_message_headers_get_one (message->response_headers, "X-Weave-Alert"));
+}
+
+void
+ephy_sync_bookmarks_check_storage_collection (void)
+{
+ EphySyncService *service;
+ gchar *endpoint;
+
+ service = ephy_shell_get_global_sync_service (ephy_shell_get_default ());
+ endpoint = g_strdup_printf ("storage/%s", EPHY_BOOKMARKS_COLLECTION);
+ ephy_sync_service_send_storage_message (service, endpoint,
+ SOUP_METHOD_GET, NULL, -1, -1,
+ server_response_default_cb, NULL);
+ g_free (endpoint);
+}
+
+void
+ephy_sync_bookmarks_delete_storage_collection (void)
+{
+ EphySyncService *service;
+ gchar *endpoint;
+
+ service = ephy_shell_get_global_sync_service (ephy_shell_get_default ());
+ endpoint = g_strdup_printf ("storage/%s", EPHY_BOOKMARKS_COLLECTION);
+ ephy_sync_service_send_storage_message (service, endpoint,
+ SOUP_METHOD_DELETE, NULL, -1, -1,
+ server_response_default_cb, NULL);
+ g_free (endpoint);
+}
diff --git a/src/ephy-sync-bookmarks.h b/src/ephy-sync-bookmarks.h
index f3f72b0..47f0ccc 100644
--- a/src/ephy-sync-bookmarks.h
+++ b/src/ephy-sync-bookmarks.h
@@ -27,6 +27,10 @@ G_BEGIN_DECLS
void ephy_sync_bookmarks_create_storage_collection (void);
+void ephy_sync_bookmarks_check_storage_collection (void);
+
+void ephy_sync_bookmarks_delete_storage_collection (void);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]