[rygel] core: Error on streaming request for unstreamable
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Error on streaming request for unstreamable
- Date: Thu, 19 Aug 2010 12:59:12 +0000 (UTC)
commit 91b9110e9d804e670b823f219e283f37d40bc9f0
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Aug 19 15:56:33 2010 +0300
core: Error on streaming request for unstreamable
Throw an error on streaming request for unstreamable content. This satisfies
DLNA requirement 7.4.49.4.
src/rygel/rygel-http-get.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-http-get.vala b/src/rygel/rygel-http-get.vala
index 1b24b2c..fa1a78e 100644
--- a/src/rygel/rygel-http-get.vala
+++ b/src/rygel/rygel-http-get.vala
@@ -29,6 +29,8 @@ using Gst;
* Responsible for handling HTTP GET & HEAD client requests.
*/
internal class Rygel.HTTPGet : HTTPRequest {
+ private const string TRANSFER_MODE_HEADER = "transferMode.dlna.org";
+
public Thumbnail thumbnail;
public Subtitle subtitle;
public HTTPSeek seek;
@@ -66,6 +68,17 @@ internal class Rygel.HTTPGet : HTTPRequest {
if (this.handler == null) {
this.handler = new HTTPIdentityHandler (this.cancellable);
+
+ header = this.msg.request_headers.get_one (TRANSFER_MODE_HEADER);
+
+ if (header == "Streaming" &&
+ (!this.item.should_stream () ||
+ this.subtitle != null ||
+ this.thumbnail != null)) {
+ throw new HTTPRequestError.UNACCEPTABLE (
+ "Streaming mode not supported for '%s'",
+ item.id);
+ }
}
yield this.handle_item_request ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]