[rygel] core: Always cancel timeout after POST



commit 5e00db576b6b20685727c38e44a32b19df1932c1
Author: Jens Georg <mail jensge org>
Date:   Wed May 4 19:35:29 2011 +0200

    core: Always cancel timeout after POST
    
    This prevents some misleading "timed out while waiting for" messages.

 src/rygel/rygel-http-post.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-http-post.vala b/src/rygel/rygel-http-post.vala
index 4ec1b59..b3bd44d 100644
--- a/src/rygel/rygel-http-post.vala
+++ b/src/rygel/rygel-http-post.vala
@@ -94,7 +94,7 @@ internal class Rygel.HTTPPost : HTTPRequest {
             main_loop.quit ();
         });
 
-        Timeout.add_seconds (5, () => {
+        var timeout_id = Timeout.add_seconds (5, () => {
             debug ("Timeout while waiting for 'updated' signal on '%s'.",
                    this.item.parent.id);
             main_loop.quit ();
@@ -107,6 +107,7 @@ internal class Rygel.HTTPPost : HTTPRequest {
                this.item.parent.id,
                this.item.id);
         main_loop.run ();
+        Source.remove (timeout_id);
         debug ("Finished waiting for update signal from container '%s'",
                this.item.parent.id);
 



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