[telepathy-gabble/master] set a default value on default-socks5-proxies

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Mar 26 09:15:17 PDT 2009


---
 src/connection-manager.c |    6 +++++-
 src/connection.c         |   11 +++++++++++
 src/connection.h         |   20 ++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/src/connection-manager.c b/src/connection-manager.c
index 0336c23..21fc865 100644
--- a/src/connection-manager.c
+++ b/src/connection-manager.c
@@ -200,7 +200,7 @@ static TpCMParamSpec jabber_params[] = {
     tp_cm_param_filter_string_nonempty, NULL },
 
   { "fallback-socks5-proxies", "as", 0,
-    0, NULL,
+    TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, NULL,
     G_STRUCT_OFFSET (GabbleParams, fallback_socks5_proxies),
     NULL, NULL },
 
@@ -236,10 +236,14 @@ const TpCMProtocolSpec gabble_protocols[] = {
   { NULL, NULL }
 };
 
+const gchar *default_socks5_proxies[] = GABBLE_PARAMS_DEFAULT_SOCKS5_PROXIES;
+
 const TpCMProtocolSpec *
 gabble_connection_manager_get_protocols (void)
 {
   jabber_params[JABBER_PARAM_FALLBACK_SOCKS5_PROXIES].gtype = G_TYPE_STRV;
+  jabber_params[JABBER_PARAM_FALLBACK_SOCKS5_PROXIES].def =
+    default_socks5_proxies;
 
   return gabble_protocols;
 }
diff --git a/src/connection.c b/src/connection.c
index 93274e0..56b3e36 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -256,6 +256,8 @@ gabble_connection_constructor (GType type,
   GabbleConnection *self = GABBLE_CONNECTION (
       G_OBJECT_CLASS (gabble_connection_parent_class)->constructor (
         type, n_construct_properties, construct_params));
+  GabbleConnectionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+      GABBLE_TYPE_CONNECTION, GabbleConnectionPrivate);
 
   DEBUG("Post-construction: (GabbleConnection *)%p", self);
 
@@ -295,6 +297,15 @@ gabble_connection_constructor (GType type,
 
   self->avatar_requests = g_hash_table_new (NULL, NULL);
 
+  if (priv->fallback_socks5_proxies == NULL)
+    {
+      /* No proxies have been defined, set the default ones */
+      gchar *default_socks5_proxies[] = GABBLE_PARAMS_DEFAULT_SOCKS5_PROXIES;
+
+      g_object_set (self, "fallback-socks5-proxies", default_socks5_proxies,
+          NULL);
+    }
+
   return (GObject *) self;
 }
 
diff --git a/src/connection.h b/src/connection.h
index 5908acc..a6f6d5e 100644
--- a/src/connection.h
+++ b/src/connection.h
@@ -42,6 +42,26 @@ G_BEGIN_DECLS
 #define GABBLE_PARAMS_DEFAULT_HTTPS_PROXY_PORT           443
 #define GABBLE_PARAMS_DEFAULT_STUN_PORT                  3478
 #define GABBLE_PARAMS_DEFAULT_FALLBACK_STUN_SERVER       "stun.collabora.co.uk"
+/* List of public SOCKS5 proxies:
+ * http://coccinella.im/servers/servers_by_proxy_bytestreams.html */
+#define GABBLE_PARAMS_DEFAULT_SOCKS5_PROXIES             \
+    { "proxy.jabber.org", "proxy.jabberfr.org", "proxy.isgeek.info",\
+      "proxy2.isgeek.info", "proxy65.rooyee.biz", "proxy.4business.nl",\
+      "proxy.911910.cn", "proxy.aszlig.net", "proxy.brauchen.info",\
+      "proxy.core.im", "proxy.deshalbfrei.org", "proxy.downtempo.de",\
+      "proxy.draugr.de", "proxy.egbers.info", "proxy.headcounter.org",\
+      "proxy.im.flosoft.biz", "proxy.jabber-hispano.org",\
+      "proxy.jabber.bluendo.com", "proxy.jabber.dk", "proxy.jabber.freenet.de",\
+      "proxy.fsinf.at", "proxy.jabber.kg", "proxy.jabber.minus273.org",\
+      "proxy.jabber.planetteamspeak.com", "proxy.jabber.tf-network.de",\
+      "proxy.jabberchat.eu", "proxy.jabbernet.eu", "proxy.jabbim.cz",\
+      "proxy.jabjab.de", "proxy.jabster.pl", "proxy.nedbsd.be",\
+      "proxy.nedbsd.eu", "proxy.nedbsd.nl", "proxy.noicq.org",\
+      "proxy.schokokeks.org", "proxy.shady.nl", "proxy.silper.cz",\
+      "proxy.ubuntu-jabber.de", "proxy.ubuntu-jabber.net",\
+      "proxy65.unstable.nl", "proxy.verdammung.org", "proxy.vke.ru",\
+      "proxy.vodka-pomme.net", "proxy.xabber.de",\
+      NULL }
 
 /* order must match array of statuses in conn-presence.c */
 /* in increasing order of presence */
-- 
1.5.6.5




More information about the telepathy-commits mailing list