[gssdp] client: Do not delete internal headers



commit 1b188604c63ec8d2dfc1f7ee74399fd1b0bb6333
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 27 00:24:46 2019 +0100

    client: Do not delete internal headers
    
    The previous commit added BOOTID.UPNP.ORG and CONFIGID.UPNP.ORG headers
    using the public api. Prevent the clear function from removing them

 libgssdp/gssdp-client.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 2dfc7e3..ba4f44e 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -1085,13 +1085,25 @@ void
 gssdp_client_clear_headers (GSSDPClient *client)
 {
         GSSDPClientPrivate *priv = NULL;
+        GList *l;
 
         g_return_if_fail (GSSDP_IS_CLIENT (client));
         priv = gssdp_client_get_instance_private (client);
 
-        g_list_free_full (priv->headers,
-                          (GDestroyNotify) header_field_free);
-        priv->headers = NULL;
+        l = priv->headers;
+        while (l != NULL)
+        {
+                GList *next = l->next;
+                GSSDPHeaderField *header = l->data;
+
+                if (g_strcmp0 (header->name, "BOOTID.UPNP.ORG") != 0 &&
+                    g_strcmp0 (header->name, "CONFIGID.UPNP.ORG") != 0) {
+                        header_field_free (header);
+                        priv->headers = g_list_delete_link (priv->headers, l);
+                }
+                l = next;
+        }
+
 }
 
 /**


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