diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-22 10:28:01 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-22 10:28:01 +0000 |
commit | 5fb069a253550389704912c8c11e5291b72ee168 (patch) | |
tree | 40dfd26d2d76a07880c0fd05087c0d6612853f84 | |
parent | 0fc8f511683054634d7ba5d447e38a634400eebb (diff) |
Connector: don't try to generate a random resource
Previously, there was no way to leave the resource entirely up to the
server: while the binding code deals correctly with priv->resource being
NULL, it was impossible to make it NULL.
But the random resource generation was broken, too: the RNG was never
seeded so the resource always came out the same.
-rw-r--r-- | wocky/wocky-connector.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wocky/wocky-connector.c b/wocky/wocky-connector.c index 160ff80..707c61f 100644 --- a/wocky/wocky-connector.c +++ b/wocky/wocky-connector.c @@ -466,7 +466,7 @@ wocky_connector_set_property (GObject *object, *g_value_get_string (value) != '\0') priv->resource = g_value_dup_string (value); else - priv->resource = g_strdup_printf ("Wocky_%x", rand()); + priv->resource = NULL; break; case PROP_XMPP_PORT: priv->xmpp_port = g_value_get_uint (value); @@ -644,9 +644,9 @@ wocky_connector_class_init (WockyConnectorClass *klass) /** * WockyConnector:resource: * - * The resource (sans '/') for this connection. Will be generated - * automatically if not set. May be altered by the server anyway - * upon successful binding. + * The resource (sans '/') for this connection. If %NULL or the empty string, + * Wocky will let the server decide. Even if you specify a particular + * resource, the server may modify it. */ spec = g_param_spec_string ("resource", "resource", "XMPP resource to append to the jid", NULL, |