core: Only push read bytes, not the whole buffer
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 8 Nov 2010 20:39:03 +0000 (22:39 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 8 Nov 2010 20:39:03 +0000 (22:39 +0200)
This corrects a serious regression in seekable HTTP GET handling
introduced by commit c398c26.

src/rygel/rygel-seekable-response.vala

index 8c2274f..f5d8c60 100644 (file)
@@ -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;