[rhythmbox] daap: rework base URI construction for ipv6 compatibility (bug #584244)



commit dc00b9a0232d43dee114a028bf27979214b1eb48
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Jun 1 10:41:11 2009 +1000

    daap: rework base URI construction for ipv6 compatibility (bug #584244)
    
    Rather than building a http:// URI and making libsoup parse it, we
    fill in the URI details separately.  This is simpler and it also works
    properly when the IP address we're using happens to be IPv6.
---
 plugins/daap/rb-daap-connection.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/daap/rb-daap-connection.c b/plugins/daap/rb-daap-connection.c
index 1f89dab..1237a47 100644
--- a/plugins/daap/rb-daap-connection.c
+++ b/plugins/daap/rb-daap-connection.c
@@ -1321,7 +1321,6 @@ rb_daap_connection_connect (RBDAAPConnection        *connection,
 			    gpointer                 user_data)
 {
 	ConnectionResponseData *rdata;
-	char                   *path;
 
 	g_return_if_fail (RB_IS_DAAP_CONNECTION (connection));
 	g_return_if_fail (connection->priv->state == DAAP_GET_INFO);
@@ -1330,9 +1329,10 @@ rb_daap_connection_connect (RBDAAPConnection        *connection,
 
 	connection->priv->session = soup_session_async_new ();
 
-	path = g_strdup_printf ("http://%s:%d";, connection->priv->host, connection->priv->port);
-	connection->priv->base_uri = soup_uri_new (path);
-	g_free (path);
+	connection->priv->base_uri = soup_uri_new (NULL);
+	soup_uri_set_scheme (connection->priv->base_uri, SOUP_URI_SCHEME_HTTP);
+	soup_uri_set_host (connection->priv->base_uri, connection->priv->host);
+	soup_uri_set_port (connection->priv->base_uri, connection->priv->port);
 
 	if (connection->priv->base_uri == NULL) {
 		rb_debug ("Error parsing http://%s:%d";, connection->priv->host, connection->priv->port);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]