summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2016-06-16 11:11:39 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2017-05-05 11:01:34 +0200
commitb25a10e99562f4d4ead791e1e46584bedd898fb2 (patch)
tree0685a9ef3cef13c093953fa308a6b8a24d8713ca
parent86ffe4a11b115f6ed7e7ebdc6350f1ac719f7e73 (diff)
cookie_jar_changed
-rw-r--r--govirt/ovirt-proxy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 064ea25..07d56fb 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -1016,6 +1016,20 @@ static void ssl_ca_file_changed(GObject *gobject,
ovirt_proxy_free_tmp_ca_file(OVIRT_PROXY(gobject));
}
+static void cookie_jar_changed(SoupCookieJar *jar,
+ SoupCookie *old_cookie,
+ SoupCookie *new_cookie,
+ gpointer user_data)
+{
+ if (old_cookie == NULL) {
+ g_warning("added new cookie \"%s\"", soup_cookie_get_name(new_cookie));
+ } else if (new_cookie == NULL) {
+ g_warning("deleting cookie \"%s\"", soup_cookie_get_name(old_cookie));
+ } else {
+ g_warning("changing cookie \"%s\"", soup_cookie_get_name(new_cookie));
+ }
+}
+
static void
ovirt_proxy_init(OvirtProxy *self)
{
@@ -1027,6 +1041,8 @@ ovirt_proxy_init(OvirtProxy *self)
(GCallback)ssl_ca_file_changed, NULL);
self->priv->ssl_ca_file_changed_id = handler_id;
self->priv->cookie_jar = soup_cookie_jar_new();
+ g_signal_connect(G_OBJECT(self->priv->cookie_jar), "changed",
+ (GCallback)cookie_jar_changed, self);
rest_proxy_add_soup_feature(REST_PROXY(self),
SOUP_SESSION_FEATURE(self->priv->cookie_jar));
self->priv->additional_headers = g_hash_table_new_full(g_str_hash,