[gupnp/gupnp-1.0] service-proxy: Fix endless loop on early notify



commit 2f1280faa616a80f7cf0a1262b263d15a123ab2f
Author: Jens Georg <mail jensge org>
Date:   Mon May 27 21:21:06 2019 +0200

    service-proxy: Fix endless loop on early notify
    
    According to UDA, the service has to send the initial event AFTER making
    sure that the SUBSCRIBE call is returned.
    
    Some devices, such as the media server in Fritz OS 6 or IGD in D-Link
    DIR 635 send the initial event state BEFORE sending the answer to
    subscibe. If that happens, just ignore the event.
    
    Fixes #8

 libgupnp/gupnp-service-proxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 40c6b5a..bc209eb 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -2183,7 +2183,7 @@ server_handler (G_GNUC_UNUSED SoupServer        *soup_server,
 
         /* Get root propertyset element */
         node = xmlDocGetRootElement (doc);
-        if (node == NULL || strcmp ((char *) node->name, "propertyset")) {
+        if (node == NULL || strcmp ((char *) node->name, "propertyset") || proxy->priv->sid == NULL) {
                 /* Empty or unsupported */
                 xmlFreeDoc (doc);
 


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