[Telepathy-commits] [telepathy-gabble/master] Add fallback-stun-{server, port} properties
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Thu Feb 19 02:53:25 PST 2009
---
src/connection.c | 32 ++++++++++++++++++++++++++++++++
src/connection.h | 1 +
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/connection.c b/src/connection.c
index 8b056bc..97d83d9 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -134,6 +134,8 @@ enum
PROP_FALLBACK_CONFERENCE_SERVER,
PROP_STUN_SERVER,
PROP_STUN_PORT,
+ PROP_FALLBACK_STUN_SERVER,
+ PROP_FALLBACK_STUN_PORT,
PROP_IGNORE_SSL_ERRORS,
PROP_ALIAS,
@@ -170,6 +172,9 @@ struct _GabbleConnectionPrivate
gchar *stun_server;
guint16 stun_port;
+ gchar *fallback_stun_server;
+ guint16 fallback_stun_port;
+
gchar *fallback_conference_server;
/* authentication properties */
@@ -373,6 +378,12 @@ gabble_connection_get_property (GObject *object,
case PROP_STUN_PORT:
g_value_set_uint (value, priv->stun_port);
break;
+ case PROP_FALLBACK_STUN_SERVER:
+ g_value_set_string (value, priv->fallback_stun_server);
+ break;
+ case PROP_FALLBACK_STUN_PORT:
+ g_value_set_uint (value, priv->fallback_stun_port);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -452,6 +463,13 @@ gabble_connection_set_property (GObject *object,
case PROP_STUN_PORT:
priv->stun_port = g_value_get_uint (value);
break;
+ case PROP_FALLBACK_STUN_SERVER:
+ g_free (priv->fallback_stun_server);
+ priv->fallback_stun_server = g_value_dup_string (value);
+ break;
+ case PROP_FALLBACK_STUN_PORT:
+ priv->fallback_stun_port = g_value_get_uint (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -699,6 +717,20 @@ gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class)
0, G_MAXUINT16, GABBLE_PARAMS_DEFAULT_STUN_PORT,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class, PROP_FALLBACK_STUN_SERVER,
+ g_param_spec_string (
+ "fallback-stun-server", "fallback STUN server",
+ "Fallback STUN server.",
+ GABBLE_PARAMS_DEFAULT_FALLBACK_STUN_SERVER,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (object_class, PROP_FALLBACK_STUN_PORT,
+ g_param_spec_uint (
+ "fallback-stun-port", "fallback STUN port",
+ "Fallback STUN port.",
+ 0, G_MAXUINT16, GABBLE_PARAMS_DEFAULT_STUN_PORT,
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
g_object_class_install_property (object_class, PROP_IGNORE_SSL_ERRORS,
g_param_spec_boolean (
"ignore-ssl-errors", "Ignore SSL errors",
diff --git a/src/connection.h b/src/connection.h
index 27cc5df..5908acc 100644
--- a/src/connection.h
+++ b/src/connection.h
@@ -41,6 +41,7 @@ G_BEGIN_DECLS
#define GABBLE_PARAMS_DEFAULT_RESOURCE "Telepathy"
#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"
/* 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