diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-10-05 16:21:13 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-10-07 16:00:20 +0100 |
commit | 659e40928fce0e75d5485c865aca145fc9e79d02 (patch) | |
tree | ed413212e05f681c92948fed50ea8b4388cd5fc2 | |
parent | f2ca85bee345df1493db88bedd03a802a37b7ede (diff) |
GibberBytestreamOOB: pass address to GibberLLTransport as GSocketAddresswip-fewer-socks
-rw-r--r-- | lib/gibber/gibber-bytestream-oob.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gibber/gibber-bytestream-oob.c b/lib/gibber/gibber-bytestream-oob.c index 566a72fc..9ebe62ef 100644 --- a/lib/gibber/gibber-bytestream-oob.c +++ b/lib/gibber/gibber-bytestream-oob.c @@ -242,10 +242,7 @@ connect_to_url (GibberBytestreamOOB *self, GibberLLTransport *ll_transport; gchar **tokens; GSocketAddress *socket_address = NULL; - union { - struct sockaddr_storage storage; - struct sockaddr_in in; - } addr; + GSocketAddress *ll_address; const gchar *host, *port; gint portnum = 0; @@ -274,7 +271,7 @@ connect_to_url (GibberBytestreamOOB *self, GIBBER_TRANSPORT (priv->xmpp_connection->transport)); if (socket_address == NULL || - !g_socket_address_to_native (socket_address, &addr, sizeof (addr), NULL)) + !G_IS_INET_SOCKET_ADDRESS (socket_address)) { /* I'm too lazy to create more specific errors for this as it should * never happen while using salut anyway.. */ @@ -299,12 +296,15 @@ connect_to_url (GibberBytestreamOOB *self, goto out; } - addr.in.sin_port = g_htons ((guint16) portnum); + ll_address = g_inet_socket_address_new ( + g_inet_socket_address_get_address ((GInetSocketAddress *) socket_address), + portnum); ll_transport = gibber_ll_transport_new (); set_transport (self, GIBBER_TRANSPORT (ll_transport)); - gibber_ll_transport_open_sockaddr (ll_transport, &addr.storage, NULL); + gibber_ll_transport_open_socket_address (ll_transport, ll_address, NULL); g_object_unref (ll_transport); + g_object_unref (ll_address); out: g_strfreev (tokens); |