diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-11-27 01:20:22 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-11-27 01:25:54 +0800 |
commit | 784e99d28062c4a98da5b83d21928684fd48f7db (patch) | |
tree | 8741f4608ec04b5ddf595f12ddd9f3f8f3093424 | |
parent | 05c5d2998e6acd0216917ffd8bffe33ccfbc345c (diff) | |
download | gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar.gz gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar.bz2 gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar.lz gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar.xz gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.tar.zst gsoc2013-evolution-784e99d28062c4a98da5b83d21928684fd48f7db.zip |
EMailAutoconfig: Set SoupSession's GProxyResolver.
Pass the built-in proxy ESource to SoupSession as a GProxyResolver.
Replaces EProxy usage, which is deprecated.
-rw-r--r-- | mail/e-mail-autoconfig.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/mail/e-mail-autoconfig.c b/mail/e-mail-autoconfig.c index 2333610420..8fa43dba60 100644 --- a/mail/e-mail-autoconfig.c +++ b/mail/e-mail-autoconfig.c @@ -372,6 +372,8 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig, GError **error) { GMarkupParseContext *context; + ESourceRegistry *registry; + ESource *proxy_source; SoupMessage *soup_message; SoupSession *soup_session; ParserClosure closure; @@ -379,24 +381,18 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig, gboolean success; guint status; gchar *uri; - EProxy *proxy; - - soup_session = soup_session_new (); - - uri = g_strconcat (AUTOCONFIG_BASE_URI, domain, NULL); - proxy = e_proxy_new (); - e_proxy_setup_proxy (proxy); + registry = e_mail_autoconfig_get_registry (autoconfig); + proxy_source = e_source_registry_ref_builtin_proxy (registry); - if (e_proxy_require_proxy_for_uri (proxy, uri)) { - SoupURI *proxy_uri; - - proxy_uri = e_proxy_peek_uri_for (proxy, uri); + soup_session = soup_session_new_with_options ( + SOUP_SESSION_PROXY_RESOLVER, + G_PROXY_RESOLVER (proxy_source), + NULL); - g_object_set (soup_session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); - } + g_object_unref (proxy_source); - g_clear_object (&proxy); + uri = g_strconcat (AUTOCONFIG_BASE_URI, domain, NULL); soup_message = soup_message_new (SOUP_METHOD_GET, uri); g_free (uri); |