Commit 3b32c436 authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Attempt to serve on IPv6


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 0a9bf02d
...@@ -241,18 +241,38 @@ static void ctrl_int_adapter (SoupServer *server, ...@@ -241,18 +241,38 @@ static void ctrl_int_adapter (SoupServer *server,
gboolean gboolean
_dmap_share_server_start (DMAPShare *share) _dmap_share_server_start (DMAPShare *share)
{ {
SoupAddress *addr;
guint port = DMAP_SHARE_GET_CLASS (share)->get_desired_port (share); guint port = DMAP_SHARE_GET_CLASS (share)->get_desired_port (share);
gboolean password_required; gboolean password_required;
share->priv->server = soup_server_new (SOUP_SERVER_PORT, port, NULL); addr = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV6, port);
share->priv->server = soup_server_new (SOUP_SERVER_INTERFACE, addr, NULL);
g_object_unref (addr);
if (share->priv->server == NULL) { if (share->priv->server == NULL) {
g_warning ("Unable to start music sharing server on port %d, trying any open port", port); g_warning ("Unable to start music sharing server on port %d, trying any open port", port);
share->priv->server = soup_server_new (SOUP_SERVER_PORT, SOUP_ADDRESS_ANY_PORT, NULL); addr = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV6, SOUP_ADDRESS_ANY_PORT);
share->priv->server = soup_server_new (SOUP_SERVER_INTERFACE, addr, NULL);
g_object_unref (addr);
}
if (share->priv->server == NULL) { if (share->priv->server == NULL) {
g_warning ("Unable to start music sharing server"); g_warning ("Unable to start music sharing server, trying IPv4 only");
return FALSE; addr = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV4, port);
} share->priv->server = soup_server_new (SOUP_SERVER_INTERFACE, addr, NULL);
g_object_unref (addr);
}
if (share->priv->server == NULL) {
g_warning ("Unable to start music sharing server on port %d, trying IPv4 only, any open port", port);
addr = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV4, SOUP_ADDRESS_ANY_PORT);
share->priv->server = soup_server_new (SOUP_SERVER_INTERFACE, addr, NULL);
g_object_unref (addr);
}
if (share->priv->server == NULL) {
g_warning ("Unable to start music sharing server");
return FALSE;
} }
share->priv->port = (guint)soup_server_get_port (share->priv->server); share->priv->port = (guint)soup_server_get_port (share->priv->server);
......
...@@ -36,8 +36,8 @@ private class DPAPViewer { ...@@ -36,8 +36,8 @@ private class DPAPViewer {
string path; string path;
int fd = GLib.FileUtils.open_tmp ("dpapview.XXXXXX", out path); int fd = GLib.FileUtils.open_tmp ("dpapview.XXXXXX", out path);
GLib.FileUtils.set_contents (path, (string) ((ValaDPAPRecord) v).thumbnail, ((ValaDPAPRecord) v).filesize); GLib.FileUtils.set_contents (path, (string) ((ValaDPAPRecord) v).thumbnail, ((ValaDPAPRecord) v).filesize);
pixbuf = new Gdk.Pixbuf.from_file (path);
GLib.FileUtils.close (fd); GLib.FileUtils.close (fd);
pixbuf = new Gdk.Pixbuf.from_file (path);
GLib.FileUtils.unlink (path); GLib.FileUtils.unlink (path);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment