[rygel] core: Correct HTTP code for TimeSeek



commit 43ef48b78ac560ee265852b4dcf66699ecea177e
Author: Topi Santakivi <topi santakivi digia com>
Date:   Fri May 13 16:00:02 2011 +0300

    core: Correct HTTP code for TimeSeek
    
    This commit makes Rygel return HTTP 206 (Partial Content)
    only in the case when the Range header is present. See [1]
    for details.
    
    [1] http://tools.ietf.org/html/rfc2616#section-14.35.2

 src/rygel/rygel-http-response.vala |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/src/rygel/rygel-http-response.vala b/src/rygel/rygel-http-response.vala
index 423df4d..359df5f 100644
--- a/src/rygel/rygel-http-response.vala
+++ b/src/rygel/rygel-http-response.vala
@@ -68,10 +68,7 @@ internal class Rygel.HTTPResponse : GLib.Object, Rygel.StateMachine {
         this.cancellable = request_handler.cancellable;
         this.seek = request.seek;
 
-        var range = this.msg.request_headers.get_one("Range");
-        if ((this.seek != null &&
-            this.seek.length < this.seek.total_length) ||
-            range != null) {
+        if (request.msg.request_headers.get_one ("Range") != null) {
             this.msg.set_status (Soup.KnownStatusCode.PARTIAL_CONTENT);
         } else {
             this.msg.set_status (Soup.KnownStatusCode.OK);



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