[librest] Attach SoupLogger after SoupCookieJar
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librest] Attach SoupLogger after SoupCookieJar
- Date: Thu, 14 Nov 2013 10:12:53 +0000 (UTC)
commit 024aecd486b8cd6b520565f15dc8d5f125d09509
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Nov 13 17:04:39 2013 +0100
Attach SoupLogger after SoupCookieJar
The SoupLogger instance needs to be attached last (at least after the
SoupCookieJar librest uses), otherwise REST_DEBUG=proxy will not dump the
cookie headers added by the SoupCookieJar instance.
https://bugzilla.gnome.org/show_bug.cgi?id=712231
rest/rest-proxy.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c
index 5a67759..ce52de1 100644
--- a/rest/rest-proxy.c
+++ b/rest/rest-proxy.c
@@ -254,6 +254,16 @@ rest_proxy_constructed (GObject *object)
g_object_unref (cookie_jar);
}
+ if (REST_DEBUG_ENABLED(PROXY)) {
+ SoupSessionFeature *logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0);
+ soup_session_add_feature (priv->session, logger);
+ g_object_unref (logger);
+
+ logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0);
+ soup_session_add_feature (priv->session_sync, logger);
+ g_object_unref (logger);
+ }
+
/* session lifetime is same as self, no need to keep signalid */
g_signal_connect_swapped (priv->session, "authenticate",
G_CALLBACK(authenticate), object);
@@ -436,16 +446,6 @@ rest_proxy_init (RestProxy *self)
soup_session_add_feature_by_type (priv->session_sync,
SOUP_TYPE_PROXY_RESOLVER_GNOME);
#endif
-
- if (REST_DEBUG_ENABLED(PROXY)) {
- SoupSessionFeature *logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0);
- soup_session_add_feature (priv->session, logger);
- g_object_unref (logger);
-
- logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0);
- soup_session_add_feature (priv->session_sync, logger);
- g_object_unref (logger);
- }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]