aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-07-16 00:40:38 +0800
committerMilan Crha <mcrha@redhat.com>2013-07-16 00:40:38 +0800
commitdcf302c2ba303a26f6f6a356f2f71f22f81eeb02 (patch)
tree12b328d3f649d8751c0df6236fdeb5edc70f9c87
parent6565a88ded370eb48a25377f46b5fb2a7c9307f5 (diff)
downloadgsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar.gz
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar.bz2
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar.lz
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar.xz
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.tar.zst
gsoc2013-evolution-dcf302c2ba303a26f6f6a356f2f71f22f81eeb02.zip
Bug #703389 - Proxy ignored for images
-rw-r--r--calendar/gui/itip-utils.c14
-rw-r--r--mail/e-http-request.c14
-rw-r--r--mail/e-mail-autoconfig.c15
-rw-r--r--modules/gravatar/e-gravatar-photo-source.c15
4 files changed, 58 insertions, 0 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index beb62b9189..440ae8ff46 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -2171,6 +2171,7 @@ itip_publish_comp (ECalClient *cal_client,
SoupMessage *msg;
SoupURI *real_uri;
gchar *ical_string = NULL;
+ EProxy *proxy;
toplevel = e_cal_util_new_top_level ();
icalcomponent_set_method (toplevel, ICAL_METHOD_PUBLISH);
@@ -2187,6 +2188,19 @@ itip_publish_comp (ECalClient *cal_client,
session = soup_session_async_new ();
g_object_set (session, SOUP_SESSION_TIMEOUT, 90, NULL);
+ 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);
+
real_uri = soup_uri_new (uri);
if (!real_uri || !real_uri->host) {
g_warning (G_STRLOC ": Invalid URL: %s", uri);
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index 14bfdda181..fb516f98ba 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -334,6 +334,7 @@ handle_http_request (GSimpleAsyncResult *res,
CamelStream *cache_stream;
GError *error;
GMainContext *context;
+ EProxy *proxy;
context = g_main_context_new ();
g_main_context_push_thread_default (context);
@@ -342,6 +343,19 @@ handle_http_request (GSimpleAsyncResult *res,
SOUP_SESSION_TIMEOUT, 90,
NULL);
+ 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);
+
message = soup_message_new (SOUP_METHOD_GET, uri);
soup_message_headers_append (
message->request_headers, "User-Agent", "Evolution/" VERSION);
diff --git a/mail/e-mail-autoconfig.c b/mail/e-mail-autoconfig.c
index 61fe0c6f75..ca0b96405f 100644
--- a/mail/e-mail-autoconfig.c
+++ b/mail/e-mail-autoconfig.c
@@ -377,10 +377,25 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig,
gboolean success;
guint status;
gchar *uri;
+ EProxy *proxy;
soup_session = soup_session_sync_new ();
uri = g_strconcat (AUTOCONFIG_BASE_URI, domain, NULL);
+
+ 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 (soup_session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
+ }
+
+ g_clear_object (&proxy);
+
soup_message = soup_message_new (SOUP_METHOD_GET, uri);
g_free (uri);
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 <libsoup/soup.h>
#include <libsoup/soup-requester.h>
#include <libsoup/soup-request-http.h>
+#include <libedataserver/libedataserver.h>
#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));