[evolution] EMailAutoconfig: Set SoupSession's GProxyResolver.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EMailAutoconfig: Set SoupSession's GProxyResolver.
- Date: Tue, 26 Nov 2013 22:09:03 +0000 (UTC)
commit 784e99d28062c4a98da5b83d21928684fd48f7db
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Nov 26 12:20:22 2013 -0500
EMailAutoconfig: Set SoupSession's GProxyResolver.
Pass the built-in proxy ESource to SoupSession as a GProxyResolver.
Replaces EProxy usage, which is deprecated.
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 2333610..8fa43db 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]