[rygel/rygel-0-10] core: Fix insane memory leak in HTTPPost



commit 7a7afa43a3b17d899e3937634239d0b38bdc1374
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
    
    Conflicts:
    
    	src/rygel/rygel-http-post.vala

 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 4ec1b59..364e971 100644
--- a/src/rygel/rygel-http-post.vala
+++ b/src/rygel/rygel-http-post.vala
@@ -38,6 +38,7 @@ internal class Rygel.HTTPPost : HTTPRequest {
                      Soup.Server  server,
                      Soup.Message msg) {
         base (http_server, server, msg);
+        msg.request_body.set_accumulate (false);
     }
 
     protected override async void handle () throws Error {
@@ -115,10 +116,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]