[PATCH] Don't send interleaved byebye/alive on startup



According to UPnP CTT, there should not be any byebye message after
the device sent an alive message. So we need to group the initial
byebye messages (also requested by the tool, UDA-1.1.3) to come
before the initial alive messages.

Partially fixes UDA-1.1.1 - UDA-1.1.1
---
 libgssdp/gssdp-resource-group.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libgssdp/gssdp-resource-group.c b/libgssdp/gssdp-resource-group.c
index 7be1a7e..0b7f880 100644
--- a/libgssdp/gssdp-resource-group.c
+++ b/libgssdp/gssdp-resource-group.c
@@ -532,6 +532,20 @@ gssdp_resource_group_set_available (GSSDPResourceGroup *resource_group,
 
                 g_source_unref (resource_group->priv->timeout_src);
 
+                for (l = resource_group->priv->resources; l; l = l->next) {
+                        Resource *resource = (Resource *) l->data;
+
+                        if (!resource->initial_alive_sent) {
+                                /* Unannounce before first announce. This is
+                                   done to minimize the possibility of
+                                   control points thinking that this is just
+                                   a reannouncement. */
+                                resource_byebye (resource);
+
+                                resource->initial_alive_sent = TRUE;
+                        }
+                }
+
                 /* Announce all resources */
                 for (l = resource_group->priv->resources; l; l = l->next)
                         resource_alive (l->data);
-- 
1.7.5.1



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