[rygel] core: Add *-Range headers only for Range request



commit b92b7a801861099bba0714ce8ffd6f04a0033146
Author: Jens Georg <mail jensge org>
Date:   Sat Sep 4 20:14:36 2010 +0200

    core: Add *-Range headers only for Range request
    
    If the client didn't pass a Range header in the request, don't
    append Accept-Ranges and Content-Range headers to response.
    
    This fixes picture browsing on XBox 360 (again)

 src/rygel/rygel-http-byte-seek.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/rygel/rygel-http-byte-seek.vala b/src/rygel/rygel-http-byte-seek.vala
index fbded5e..86a6c47 100644
--- a/src/rygel/rygel-http-byte-seek.vala
+++ b/src/rygel/rygel-http-byte-seek.vala
@@ -96,12 +96,14 @@ internal class Rygel.HTTPByteSeek : Rygel.HTTPSeek {
         var range = "bytes ";
         unowned Soup.MessageHeaders headers = this.msg.response_headers;
 
-        headers.append ("Accept-Ranges", "bytes");
+        if (this.msg.request_headers.get_one ("Range") != null) {
+            headers.append ("Accept-Ranges", "bytes");
 
-        range += this.start.to_string () + "-" +
-                 this.stop.to_string () + "/" +
-                 this.total_length.to_string ();
-        headers.append ("Content-Range", range);
+            range += this.start.to_string () + "-" +
+                     this.stop.to_string () + "/" +
+                     this.total_length.to_string ();
+            headers.append ("Content-Range", range);
+        }
 
         headers.set_content_length (this.length);
     }



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