aboutsummaryrefslogtreecommitdiffstats
path: root/capplet/settings
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-04-20 00:13:14 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-04-20 00:13:14 +0800
commit8505a33d996442ba045333883518d744263ead23 (patch)
tree84997679312620f35db5378576a37756cd6e28df /capplet/settings
parent574b961a0f75d5fe928e2e529712d39cc1062162 (diff)
downloadgsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar.gz
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar.bz2
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar.lz
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar.xz
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.tar.zst
gsoc2013-evolution-8505a33d996442ba045333883518d744263ead23.zip
add proxy support to auto-configuration
Diffstat (limited to 'capplet/settings')
-rw-r--r--capplet/settings/mail-guess-servers.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c
index 6f42680f11..f94fbb90e6 100644
--- a/capplet/settings/mail-guess-servers.c
+++ b/capplet/settings/mail-guess-servers.c
@@ -42,6 +42,8 @@
#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
+#include <libedataserver/e-proxy.h>
+
#include <shell/e-shell.h>
#include "mail-guess-servers.h"
@@ -242,10 +244,14 @@ guess_when_online (EmailProvider *provider)
{
const gchar *cafile = NULL;
gchar *url;
- SoupURI *proxy = NULL, *parsed;
+ EProxy *proxy;
+ SoupURI *parsed;
SoupMessage *msg;
SoupSession *session;
+ proxy = e_proxy_new ();
+ e_proxy_setup_proxy (proxy);
+
url = g_strdup_printf("%s/%s", "http://api.gnome.org/evolution/autoconfig", provider->domain);
parsed = soup_uri_new (url);
soup_uri_free (parsed);
@@ -255,10 +261,11 @@ guess_when_online (EmailProvider *provider)
SOUP_SESSION_USER_AGENT, "get ",
NULL);
- if (proxy) {
- g_object_set (G_OBJECT (session),
- SOUP_SESSION_PROXY_URI, proxy,
- NULL);
+ if (e_proxy_require_proxy_for_uri (proxy, url)) {
+ SoupURI *proxy_uri = e_proxy_peek_uri_for (proxy, url);
+/* fprintf (stderr, "URL '%s' requires a proxy: '%s'\n",
+ url, soup_uri_to_string (proxy_uri, FALSE)); */
+ g_object_set (session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
}
msg = get_url (session, url);
@@ -267,6 +274,7 @@ guess_when_online (EmailProvider *provider)
parse_soup_message (msg, provider);
+ g_object_unref (proxy);
g_object_unref (msg);
g_object_unref(session);
g_free(url);