summaryrefslogtreecommitdiff
path: root/libdleyna/renderer/upnp.c
diff options
context:
space:
mode:
authorLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-09-16 15:20:26 +0200
committerLudovic Ferrandis <ludovic.ferrandis@intel.com>2013-09-16 15:25:25 +0200
commitc60ec4fb2df0e9a67f3bf6c7b9e0436e9c73de6c (patch)
tree8476e24683cb4f6a3e238a4e1a4164275a1000c7 /libdleyna/renderer/upnp.c
parent47fa9521e80b32877a41f5945c2357d80c557b2f (diff)
downloaddleyna-renderer-c60ec4fb2df0e9a67f3bf6c7b9e0436e9c73de6c.tar.gz
[Path] Make object paths stable across restarts
Fix issue #114: <https://github.com/01org/dleyna-renderer/issues/114> Root paths for servers were builded using an incremental counter, based of the discovery order made by GSSDP: Results were of this form: /com/intel/dLeynaRenderer/server/0 /com/intel/dLeynaRenderer/server/1 Object paths were builded on these root paths: /com/intel/dLeynaRenderer/server/0/xxxxxxxxxx There is no persistence between restarts of dleyna because we can't assign the same index to the same server. To fix this issue, we replace the volatile part of the root path, id the index, by a non volatile and unique part, id the server udn. The server udn is a string of this form: "uuid:<uuid string>" <uuid string> is defined by RFC 4122(<http://www.ietf.org/rfc/rfc4122.txt> and it's composed only with hex digit and char '-' To make the path compatible with dbus and 'reversible': 1 - remove the prefix 'uuid:' 2 - convert '-' char to '_' char Result is of the form below: /com/intel/dLeynaRenderer/server/99951d71_23d5_5525_94eb_a4aa78a98211 This path is stable accross dleyna restart and identify uniquely a server. This can be sued to save object path and to use them after multiple restart of the server and dLeyna. Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna/renderer/upnp.c')
-rw-r--r--libdleyna/renderer/upnp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libdleyna/renderer/upnp.c b/libdleyna/renderer/upnp.c
index fefc340..bd9a688 100644
--- a/libdleyna/renderer/upnp.c
+++ b/libdleyna/renderer/upnp.c
@@ -45,7 +45,6 @@ struct dlr_upnp_t_ {
void *user_data;
GHashTable *server_udn_map;
GHashTable *server_uc_map;
- guint counter;
dlr_host_service_t *host_service;
};
@@ -186,14 +185,10 @@ static void prv_server_available_cb(GUPnPControlPoint *cp,
queue_id = prv_create_device_queue(&priv_t);
device = dlr_device_new(upnp->connection, proxy, ip_address,
- upnp->counter,
- upnp->interface_info,
- queue_id);
+ udn, upnp->interface_info, queue_id);
prv_update_device_context(priv_t, upnp, udn, device, ip_address,
queue_id);
-
- upnp->counter++;
} else {
DLEYNA_LOG_DEBUG("Device Found");