core: Delay handling of SoupMessage's signals
authorJens Georg <mail@jensge.org>
Tue, 27 Sep 2011 12:42:37 +0000 (14:42 +0200)
committerJens Georg <mail@jensge.org>
Tue, 27 Sep 2011 12:42:37 +0000 (14:42 +0200)
Only connect to the relevant signals just before unpause_message
happens. Otherwise we might get stray signals when one of the
preconditions checked fails.

src/rygel/rygel-http-post.vala

index c9a5b75..c1bad97 100644 (file)
@@ -58,9 +58,6 @@ internal class Rygel.HTTPPost : HTTPRequest {
     }
 
     private async void handle_real () throws Error {
-        this.msg.got_chunk.connect (this.on_got_chunk);
-        this.msg.got_body.connect (this.on_got_body);
-
         if (!this.item.place_holder) {
             var msg = _("Pushing data to non-empty item '%s' not allowed");
 
@@ -83,6 +80,9 @@ internal class Rygel.HTTPPost : HTTPRequest {
                                          Priority.LOW,
                                          this.cancellable);
 
+        this.msg.got_chunk.connect (this.on_got_chunk);
+        this.msg.got_body.connect (this.on_got_body);
+
         this.server.unpause_message (this.msg);
         this.handle_continue = this.handle_real.callback;