From 7d85ab77111fa9321dd2f22edae538d22decd989 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Sun, 18 Jan 2009 19:26:59 +0000 Subject: [PATCH] GstStream decides about chunking of message. svn path=/trunk/; revision=441 --- src/rygel/rygel-gst-stream.vala | 7 +++++++ src/rygel/rygel-stream.vala | 8 ++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/rygel/rygel-gst-stream.vala b/src/rygel/rygel-gst-stream.vala index 68bd222..a22314f 100644 --- a/src/rygel/rygel-gst-stream.vala +++ b/src/rygel/rygel-gst-stream.vala @@ -47,6 +47,9 @@ public class Rygel.GstStream : Rygel.Stream { Element src) throws Error { base (server, msg, false); + this.msg.response_headers.set_encoding (Soup.Encoding.CHUNKED); + this.msg.response_body.set_accumulate (false); + this.buffers = new AsyncQueue (); this.prepare_pipeline (name, src); @@ -65,6 +68,10 @@ public class Rygel.GstStream : Rygel.Stream { buffer = this.buffers.try_pop (); } while (buffer != null); + if (!aborted) { + this.msg.response_body.complete (); + } + base.end (aborted); } diff --git a/src/rygel/rygel-stream.vala b/src/rygel/rygel-stream.vala index 2b6795b..94ffc78 100644 --- a/src/rygel/rygel-stream.vala +++ b/src/rygel/rygel-stream.vala @@ -35,13 +35,13 @@ public class Rygel.Stream : GLib.Object { this.server = server; this.msg = msg; - this.msg.response_headers.set_encoding (Soup.Encoding.CHUNKED); + server.pause_message (this.msg); + if (partial) { this.msg.set_status (Soup.KnownStatusCode.PARTIAL_CONTENT); } else { this.msg.set_status (Soup.KnownStatusCode.OK); } - this.msg.response_body.set_accumulate (false); this.server.request_aborted += on_request_aborted; } @@ -67,10 +67,6 @@ public class Rygel.Stream : GLib.Object { } public virtual void end (bool aborted) { - if (!aborted) { - this.msg.response_body.complete (); - } - this.eos (); } } -- 2.7.4