[rygel] core: Fix insane memory leak in HTTPPost



commit f12ad10bb60ce87f3aaf1c06baead5ea2cc184ee
Author: Jens Georg <mail jensge org>
Date:   Mon Jul 11 13:26:13 2011 +0200

    core: Fix insane memory leak in HTTPPost
    
     - Don't accumulate message chunks in Soup.Message
     - Don't use vala async support to write buffers. This can delay
       release of chunks that much that OOM is hit

 src/rygel/rygel-http-post.vala |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/src/rygel/rygel-http-post.vala b/src/rygel/rygel-http-post.vala
index e0a3590..828a7f2 100644
--- a/src/rygel/rygel-http-post.vala
+++ b/src/rygel/rygel-http-post.vala
@@ -40,6 +40,7 @@ internal class Rygel.HTTPPost : HTTPRequest {
         base (http_server, server, msg);
 
         this.cancellable.connect (this.on_request_cancelled);
+        msg.request_body.set_accumulate (false);
     }
 
     protected override async void handle () throws Error {
@@ -125,10 +126,6 @@ internal class Rygel.HTTPPost : HTTPRequest {
     }
 
     private void on_got_chunk (Message msg, Buffer chunk) {
-        this.write_chunk.begin (chunk);
-    }
-
-    private async void write_chunk (Buffer chunk) {
         try {
             this.stream.write (chunk.data, this.cancellable);
         } catch (Error error) {



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