[rygel] core: Only push read bytes, not the whole buffer



commit 4b14f8b1b8ef3f313bb72b1dbf5cb06a76fdebcf
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Nov 8 22:39:03 2010 +0200

    core: Only push read bytes, not the whole buffer
    
    This corrects a serious regression in seekable HTTP GET handling
    introduced by commit c398c26.

 src/rygel/rygel-seekable-response.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-seekable-response.vala b/src/rygel/rygel-seekable-response.vala
index 8c2274f..f5d8c60 100644
--- a/src/rygel/rygel-seekable-response.vala
+++ b/src/rygel/rygel-seekable-response.vala
@@ -119,7 +119,10 @@ internal class Rygel.SeekableResponse : Rygel.HTTPResponse {
         });
 
         while (bytes_read > 0) {
-            this.push_data (this.buffer, bytes_read);
+            // FIXME: Remove redundant assingment after we bump our vala dep
+            //        to 0.11.2
+            var data = this.buffer[0:bytes_read];
+            this.push_data (data, bytes_read);
             this.total_length -= bytes_read;
 
             this.run_continue = read_contents.callback;



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