[rygel] core: Only error out on forbidden flags



commit 033dd1a0a58333ad863a06f49d509a2b04db5797
Author: Santakivi Topi <Topi Santakivi digia com>
Date:   Thu Apr 28 14:47:46 2011 +0300

    core: Only error out on forbidden flags
    
    Previously ItemCreator was throwing a bad metadata error if any bit of
    dlnaManaged was set in the DIDL item. Now we only do so if forbidden
    bits were set.
    
    This satisfies DLNA requirement 7.3.118.4.

 src/rygel/rygel-item-creator.vala |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 03cf0db..5be7a91 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -70,10 +70,13 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
                 throw new ItemCreatorError.PARSE (message, this.elements);
             }
 
-            if (didl_item.dlna_managed != 0) {
+            if ((didl_item.dlna_managed &
+                (OCMFlags.UPLOAD |
+                 OCMFlags.CREATE_CONTAINER |
+                 OCMFlags.UPLOAD_DESTROYABLE)) != 0) {
                 throw new ContentDirectoryError.BAD_METADATA
-                                        ("Attribute 'dlnaManaged' must not" +
-                                         " be set");
+                                        ("Flags that must not be set " +
+                                         "were found in 'dlnaManaged'");
             }
 
             var container = yield this.fetch_container ();



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