diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-11-27 02:33:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-11-27 06:00:55 +0800 |
commit | 989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6 (patch) | |
tree | 723d2bf4a63d4438f500c40293d5af2105c910e6 /mail | |
parent | 7f008d11a274f4c05a1ceec579a1c717af396457 (diff) | |
download | gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar.gz gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar.bz2 gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar.lz gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar.xz gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.tar.zst gsoc2013-evolution-989efd6c2ee3251e72e96c40e3f2e8c71c35e7b6.zip |
EHttpRequest: Simplify proxy handling.
When creating a temporary SoupSession, synchronize its GProxyResolver
with the SoupRequest's SoupSession which is already configured to use
our built-in proxy ESource.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-http-request.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/mail/e-http-request.c b/mail/e-http-request.c index 508ad4febe..f57bd62e55 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -166,6 +166,7 @@ handle_http_request (GSimpleAsyncResult *res, EHTTPRequestPrivate *priv; SoupURI *soup_uri; SoupRequest *soup_request; + SoupSession *soup_session; gchar *evo_uri, *uri; gchar *mail_uri; GInputStream *stream; @@ -186,6 +187,7 @@ handle_http_request (GSimpleAsyncResult *res, priv = E_HTTP_REQUEST_GET_PRIVATE (source_object); soup_request = SOUP_REQUEST (source_object); + soup_session = soup_request_get_session (soup_request); /* Remove the __evo-mail query */ soup_uri = soup_request_get_uri (soup_request); @@ -359,7 +361,6 @@ handle_http_request (GSimpleAsyncResult *res, GIOStream *cache_stream; GError *error; GMainContext *context; - EProxy *proxy; context = g_main_context_new (); g_main_context_push_thread_default (context); @@ -367,18 +368,10 @@ handle_http_request (GSimpleAsyncResult *res, temp_session = soup_session_new_with_options ( 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 (temp_session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); - } - - g_clear_object (&proxy); + g_object_bind_property ( + soup_session, "proxy-resolver", + temp_session, "proxy-resolver", + G_BINDING_SYNC_CREATE); message = soup_message_new (SOUP_METHOD_GET, uri); soup_message_headers_append ( |