[rygel] core: Rename an HTTPSeek method



commit 8539f095355a0e6d2a384d645c6900cd78878861
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Dec 7 16:33:37 2009 +0200

    core: Rename an HTTPSeek method
    
    Rename HTTPSeek.add_response_header to add_response_headers.

 src/rygel/rygel-http-identity-handler.vala  |   12 +++++++-----
 src/rygel/rygel-http-seek.vala              |    2 +-
 src/rygel/rygel-http-transcode-handler.vala |    4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala
index 94aaf37..008dfcb 100644
--- a/src/rygel/rygel-http-identity-handler.vala
+++ b/src/rygel/rygel-http-identity-handler.vala
@@ -50,15 +50,17 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPRequestHandler {
 
         if (request.thumbnail == null && request.item.should_stream ()) {
             if (request.time_range != null) {
-                request.time_range.add_response_header (request.msg,
-                                                        request.item.duration);
+                request.time_range.add_response_headers (request.msg,
+                                                         request.item.duration);
             }
         } else {
             request.msg.response_headers.append ("Accept-Ranges", "bytes");
             if (request.byte_range != null) {
-                request.msg.response_headers.set_content_length (
-                                                   request.byte_range.length);
-                request.byte_range.add_response_header (request.msg, size);
+                var length = request.byte_range.length;
+                if (length > 0) {
+                    request.msg.response_headers.set_content_length (length);
+                }
+                request.byte_range.add_response_headers (request.msg, size);
             }
         }
 
diff --git a/src/rygel/rygel-http-seek.vala b/src/rygel/rygel-http-seek.vala
index f08e0f6..67970a8 100644
--- a/src/rygel/rygel-http-seek.vala
+++ b/src/rygel/rygel-http-seek.vala
@@ -143,7 +143,7 @@ internal class Rygel.HTTPSeek : GLib.Object {
         return new HTTPSeek (Format.TIME, start, stop);
     }
 
-    public void add_response_header (Soup.Message msg, int64 length) {
+    public void add_response_headers (Soup.Message msg, int64 length) {
         string header;
         string value;
         double start = 0;
diff --git a/src/rygel/rygel-http-transcode-handler.vala b/src/rygel/rygel-http-transcode-handler.vala
index 0ca6bf3..05ce34d 100644
--- a/src/rygel/rygel-http-transcode-handler.vala
+++ b/src/rygel/rygel-http-transcode-handler.vala
@@ -41,8 +41,8 @@ internal class Rygel.HTTPTranscodeHandler : HTTPRequestHandler {
         request.msg.response_headers.append ("Content-Type",
                                              this.transcoder.mime_type);
         if (request.time_range != null) {
-            request.time_range.add_response_header (request.msg,
-                                                    request.item.duration);
+            request.time_range.add_response_headers (request.msg,
+                                                     request.item.duration);
         }
 
         // Chain-up



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