[rygel] core: Content-Length was off by 1 byte



commit 9d2f7c62902e8c8cf9e4dcec5926ff7da0c22c7d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Mar 23 14:31:25 2010 +0200

    core: Content-Length was off by 1 byte

 src/rygel/rygel-http-byte-seek.vala  |    2 +-
 tests/rygel-http-byte-seek-test.vala |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel/rygel-http-byte-seek.vala b/src/rygel/rygel-http-byte-seek.vala
index fab01ba..08257b8 100644
--- a/src/rygel/rygel-http-byte-seek.vala
+++ b/src/rygel/rygel-http-byte-seek.vala
@@ -95,6 +95,6 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek {
                  this.length.to_string ();
         headers.append ("Content-Range", range);
 
-        headers.set_content_length (this.stop - this.start);
+        headers.set_content_length (this.stop + 1 - this.start);
     }
 }
diff --git a/tests/rygel-http-byte-seek-test.vala b/tests/rygel-http-byte-seek-test.vala
index 88c08c2..bdc2fc9 100644
--- a/tests/rygel-http-byte-seek-test.vala
+++ b/tests/rygel-http-byte-seek-test.vala
@@ -148,6 +148,6 @@ private class Rygel.HTTPByteSeekTest : GLib.Object {
         assert (this.range_regex.match (header));
 
         assert (request.msg.response_headers.get_content_length () ==
-                seek.stop - seek.start);
+                seek.stop + 1 - seek.start);
     }
 }



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