[gupnp-tools/wip/new-upnp] av-cp: Rewrite URI for getting device icons



commit 0e2de02a4fa36936e66102b858099db05e5e95f3
Author: Jens Georg <mail jensge org>
Date:   Tue Nov 20 23:15:48 2018 +0100

    av-cp: Rewrite URI for getting device icons

 src/common/icons.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/common/icons.c b/src/common/icons.c
index 51a986b..3419f8d 100644
--- a/src/common/icons.c
+++ b/src/common/icons.c
@@ -167,14 +167,17 @@ schedule_icon_update (GUPnPDeviceInfo            *info,
                 return;
         }
 
-        data->message = soup_message_new (SOUP_METHOD_GET, icon_url);
+        char *new_uri = gupnp_context_rewrite_uri (gupnp_device_info_get_context (info), icon_url);
+        g_free (icon_url);
+
+        data->message = soup_message_new (SOUP_METHOD_GET, new_uri);
 
         if (data->message == NULL) {
                 g_warning ("Invalid URL icon for device '%s': %s",
                            gupnp_device_info_get_udn (info),
-                           icon_url);
+                           new_uri);
 
-                g_free (icon_url);
+                g_free (new_uri);
                 g_free (data->mime_type);
                 g_idle_add (on_icon_schedule_error, data);
 
@@ -187,7 +190,7 @@ schedule_icon_update (GUPnPDeviceInfo            *info,
                                     (SoupSessionCallback) got_icon_url,
                                     data);
 
-        g_free (icon_url);
+        g_free (new_uri);
 }
 
 void


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