[rygel] server: Fix range requests in the form of start-



commit 771907a074fb48f184d5b34cb715bf5f94084ed1
Author: Jens Georg <mail jensge org>
Date:   Thu Feb 12 23:07:06 2015 +0100

    server: Fix range requests in the form of start-
    
    Otherwise the code would spill out start--1/total_size

 .../rygel-http-byte-seek-request.vala              |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-server/rygel-http-byte-seek-request.vala 
b/src/librygel-server/rygel-http-byte-seek-request.vala
index 38969f9..4e57b50 100644
--- a/src/librygel-server/rygel-http-byte-seek-request.vala
+++ b/src/librygel-server/rygel-http-byte-seek-request.vala
@@ -94,8 +94,12 @@ public class Rygel.HTTPByteSeekRequest : Rygel.HTTPSeekRequest {
         }
 
         if (range_tokens[1] == null || (range_tokens[1].length == 0)) {
-            end_byte = UNSPECIFIED;
-            range_length = UNSPECIFIED;
+            end_byte = total_size;
+            if (total_size != UNSPECIFIED) {
+                range_length = end_byte - start_byte + 1; // range is inclusive
+            } else {
+                range_length = UNSPECIFIED;
+            }
         } else {
             if (!int64.try_parse (strip_leading_zeros(range_tokens[1]), out end_byte)) {
                 throw new HTTPSeekRequestError.INVALID_RANGE


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