server: Fix check for invalid OCM flags
authorJens Georg <jensg@openismus.com>
Thu, 7 Mar 2013 12:52:20 +0000 (13:52 +0100)
committerJens Georg <jensg@openismus.com>
Tue, 2 Apr 2013 10:07:06 +0000 (12:07 +0200)
This check has to be applied to items only, not all objects.

https://bugzilla.gnome.org/show_bug.cgi?id=694155

src/librygel-server/rygel-object-creator.vala

index 2eedfe9..169650f 100644 (file)
@@ -237,10 +237,12 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
         }
 
         // FIXME: Is this check really necessary? 7.3.118.4 passes without it.
-        if ((didl_object.dlna_managed &
-            (OCMFlags.UPLOAD |
-             OCMFlags.CREATE_CONTAINER |
-             OCMFlags.UPLOAD_DESTROYABLE)) != 0) {
+        // These flags must not be set on items.
+        if (didl_object is DIDLLiteItem &&
+            ((didl_object.dlna_managed &
+             (OCMFlags.UPLOAD |
+              OCMFlags.CREATE_CONTAINER |
+              OCMFlags.UPLOAD_DESTROYABLE)) != 0)) {
             throw new ContentDirectoryError.BAD_METADATA
                                         ("Flags that must not be set " +
                                          "were found in 'dlnaManaged'");