From 92e663be86868f0bed69b402812c1ee107c039ee Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 13 Nov 2013 17:04:39 +0100 Subject: 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 (cherry picked from commit 024aecd486b8cd6b520565f15dc8d5f125d09509) --- rest/rest-proxy.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c index d3ebaba..ba0d515 100644 --- a/rest/rest-proxy.c +++ b/rest/rest-proxy.c @@ -253,6 +253,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); @@ -432,16 +442,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); - } } /** -- cgit v1.2.3