[rygel] server: Only create seek when requested



commit 426d7418fa7395ea3cf0e5b94cb8d834a11bcc9a
Author: Jens Georg <jensg openismus com>
Date:   Thu Oct 11 23:00:23 2012 +0200

    server: Only create seek when requested
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685800

 src/librygel-server/rygel-http-get.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/librygel-server/rygel-http-get.vala b/src/librygel-server/rygel-http-get.vala
index 4e8d3e6..a6ea908 100644
--- a/src/librygel-server/rygel-http-get.vala
+++ b/src/librygel-server/rygel-http-get.vala
@@ -125,17 +125,19 @@ internal class Rygel.HTTPGet : HTTPRequest {
 
     private async void handle_item_request () throws Error {
         var need_time_seek = HTTPTimeSeek.needed (this);
+        var requested_time_seek = HTTPTimeSeek.requested (this);
         var need_byte_seek = HTTPByteSeek.needed (this);
+        var requested_byte_seek = HTTPByteSeek.requested (this);
 
-        if ((HTTPTimeSeek.requested (this) && !need_time_seek) ||
-            (HTTPByteSeek.requested (this) && !need_byte_seek)) {
+        if ((requested_time_seek && !need_time_seek) ||
+            (requested_byte_seek && !need_byte_seek)) {
             throw new HTTPRequestError.UNACCEPTABLE ("Invalid seek request");
         }
 
         try {
-            if (need_time_seek) {
+            if (need_time_seek && requested_time_seek) {
                 this.seek = new HTTPTimeSeek (this);
-            } else if (need_byte_seek) {
+            } else if (need_byte_seek && requested_byte_seek) {
                 this.seek = new HTTPByteSeek (this);
             }
         } catch (HTTPSeekError error) {



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