[rygel] core: Respond with 712 for DIDL parse failure



commit f077fc0d5f40d128d4cd835c8723562de2c5a2f0
Author: Topi Santakivi <topi santakivi digia com>
Date:   Wed Jun 1 16:39:21 2011 +0300

    core: Respond with 712 for DIDL parse failure
    
    In case the DIDL-lite parsing fails, e.g. due to an invalid
    @restricted value in the XML, Rygel must respond with error
    BAD METADATA (712). Satisfies DLNA guideline 7.3.134.1.

 src/rygel/rygel-item-creator.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index fdaa11e..9bc640a 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -63,7 +63,13 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
             this.didl_parser.item_available.connect ((didl_item) => {
                     this.didl_item = didl_item;
             });
-            this.didl_parser.parse_didl (this.elements);
+
+            try {
+                this.didl_parser.parse_didl (this.elements);
+            } catch (Error parse_err) {
+                throw new ContentDirectoryError.BAD_METADATA ("Bad metadata");
+            }
+
             if (this.didl_item == null) {
                 var message = _("No items in DIDL-Lite from client: '%s'");
 



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