From dcf302c2ba303a26f6f6a356f2f71f22f81eeb02 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 15 Jul 2013 18:40:38 +0200 Subject: Bug #703389 - Proxy ignored for images --- modules/gravatar/e-gravatar-photo-source.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/gravatar') diff --git a/modules/gravatar/e-gravatar-photo-source.c b/modules/gravatar/e-gravatar-photo-source.c index 655046cd14..b41c689712 100644 --- a/modules/gravatar/e-gravatar-photo-source.c +++ b/modules/gravatar/e-gravatar-photo-source.c @@ -21,6 +21,7 @@ #include #include #include +#include #define E_GRAVATAR_PHOTO_SOURCE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -69,6 +70,7 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple, GInputStream *stream = NULL; gchar *hash; gchar *uri; + EProxy *proxy; GError *local_error = NULL; async_context = g_simple_async_result_get_op_res_gpointer (simple); @@ -81,6 +83,19 @@ gravatar_photo_source_get_photo_thread (GSimpleAsyncResult *simple, session = soup_session_sync_new (); + proxy = e_proxy_new (); + e_proxy_setup_proxy (proxy); + + if (e_proxy_require_proxy_for_uri (proxy, uri)) { + SoupURI *proxy_uri; + + proxy_uri = e_proxy_peek_uri_for (proxy, uri); + + g_object_set (session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); + } + + g_clear_object (&proxy); + requester = soup_requester_new (); soup_session_add_feature (session, SOUP_SESSION_FEATURE (requester)); -- cgit v1.2.3