After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705564 - 7.3.63.6: browse/search result should have no dlna namespace if not present in filter args
7.3.63.6: browse/search result should have no dlna namespace if not present i...
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
: 702556 (view as bug list)
Depends on: 706928
Blocks:
 
 
Reported: 2013-08-06 13:38 UTC by Parthiban Balasubramanian
Modified: 2019-02-22 05:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Removing dlna namespace when requested in filter args (1.69 KB, patch)
2013-08-06 13:39 UTC, Parthiban Balasubramanian
none Details | Review
Removing dlna namespace when not requested in filter args (1.68 KB, patch)
2013-08-06 13:46 UTC, Parthiban Balasubramanian
none Details | Review
Add dlna namespace only when requested in filter args (5.26 KB, patch)
2013-09-03 20:29 UTC, Parthiban Balasubramanian
committed Details | Review
Add utility functions for ns creation (7.94 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review
Add utility function to find namespaces (5.51 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review
Add utility function to lazy-create ns (2.13 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review
Lazy-create XML namespaces (19.74 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review
Revert "Add dlna namespace only when it's actually used" (4.49 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review
Add testcase for bgo705564#c12 (2.28 KB, patch)
2014-02-01 13:31 UTC, Jens Georg
committed Details | Review

Description Parthiban Balasubramanian 2013-08-06 13:38:21 UTC
DLNA 7.3.63.6 guidlines states that dlna namespace must be declared only when the Filter args request for one or more dlna attributes or elements.

Tried to make a change in gupnp-av lib : apply_filter method in gupnp-didl-lite-writer.c, but I could not find a clean way to do that.
So added logic in Rygel to remove the dlna namespace after checking the filter args before sending browse/search response.
Comment 1 Parthiban Balasubramanian 2013-08-06 13:39:25 UTC
Created attachment 250966 [details] [review]
Removing dlna namespace when requested in filter args
Comment 2 Parthiban Balasubramanian 2013-08-06 13:40:03 UTC
Update : Attachment comment - "Removing dlna namespace when not requested in filter args"
Comment 3 Parthiban Balasubramanian 2013-08-06 13:46:42 UTC
Created attachment 250969 [details] [review]
Removing dlna namespace when not requested in filter args

Removed extra lines added in previous patch
Comment 4 Jens Georg 2013-08-13 11:41:08 UTC
Hm, I think the "correct" solution would be that gupnp-av only adds the namespaces if it's going to add a node or attribute from that namespace.
Comment 5 Parthiban Balasubramanian 2013-09-03 20:29:17 UTC
Created attachment 254015 [details] [review]
Add dlna namespace only when requested in filter args
Comment 6 Parthiban Balasubramanian 2013-09-03 20:32:59 UTC
@Jens : Should I create a separate gupnp-av bug for this?
Comment 7 Parthiban Balasubramanian 2013-09-03 20:35:11 UTC
@Jens : One more comment on the new patch. This patch must go after the patch included in bug 706928.
Comment 8 Jens Georg 2013-09-03 22:33:44 UTC
No need, I can just move this one
Comment 9 Jens Georg 2013-09-30 13:42:07 UTC
Review of attachment 254015 [details] [review]:

Seems to have several indenting issues, otherwise fine

::: libgupnp-av/gupnp-didl-lite-writer.c
@@ +217,3 @@
+    for (attr = node->properties; attr != NULL; attr = attr->next) {
+	    if (attr->ns && g_strcmp0 (attr->ns->prefix, "dlna") == 0) {
+	xmlAttr *attr;

Indenting issue

@@ +300,3 @@
         g_return_if_fail (filter != NULL);
 
+        if (filter[0] == '*') {

Indenting issue

@@ +319,3 @@
 
+        if (writer->priv->dlna_attr_present) {
+            xmlNewNs (writer->priv->xml_node,

Indenting issue
Comment 10 Jens Georg 2013-10-10 13:44:10 UTC
*** Bug 702556 has been marked as a duplicate of this bug. ***
Comment 11 Jens Georg 2013-10-16 11:56:31 UTC
Pushed with minor style adjustments
Comment 12 Sven Neumann 2013-12-09 20:43:23 UTC
This change breaks the DIDL-Lite XML created with GUPnPDIDLLiteWriter if the gupnp_didl_writer_filter() method is not being used. If the output is not filtered (which is as fas as I can see a perfectly valid use-case), then the DLNA namespace declaration will be missing even though you used for example gupnp_didl_lite_object_set_album_art() which adds an attriute that uses the dlna: namespace.

IMO a better fix should be found that makes sure that namespace declarations are added at the point when they are used. This would also ensure that namespaces which are likely to be unused such as the recently added pv namespace would not be added by default. If you agree, then please reopen this ticket or, if you prefer, I can open a new one.
Comment 13 Jens Georg 2013-12-10 01:04:27 UTC
meh.
Comment 14 Jens Georg 2013-12-14 14:34:33 UTC
https://git.gnome.org/browse/gupnp-av/log/?h=wip/lazy-namespaces

This doesn't take into account removing of the final "thing" in a namespace yet
Comment 15 Jens Georg 2014-02-01 13:31:29 UTC
Created attachment 267780 [details] [review]
Add utility functions for ns creation
Comment 16 Jens Georg 2014-02-01 13:31:33 UTC
Created attachment 267781 [details] [review]
Add utility function to find namespaces
Comment 17 Jens Georg 2014-02-01 13:31:37 UTC
Created attachment 267782 [details] [review]
Add utility function to lazy-create ns
Comment 18 Jens Georg 2014-02-01 13:31:40 UTC
Created attachment 267783 [details] [review]
Lazy-create XML namespaces
Comment 19 Jens Georg 2014-02-01 13:31:45 UTC
Created attachment 267784 [details] [review]
Revert "Add dlna namespace only when it's actually used"

This reverts commit 50a5e45591e7bccb79250502c22233793dc6b2cb.

Conflicts:
	libgupnp-av/gupnp-didl-lite-writer.c
Comment 20 Jens Georg 2014-02-01 13:31:48 UTC
Created attachment 267785 [details] [review]
Add testcase for bgo705564#c12

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 21 Jens Georg 2014-06-10 11:17:42 UTC
Attachment 267780 [details] pushed as fcd094d - Add utility functions for ns creation
Attachment 267781 [details] pushed as 9b4e5e8 - Add utility function to find namespaces
Attachment 267782 [details] pushed as 655de6e - Add utility function to lazy-create ns
Attachment 267783 [details] pushed as 456a9ce - Lazy-create XML namespaces
Attachment 267784 [details] pushed as 556c9a2 - Revert "Add dlna namespace only when it's actually used"