[rygel] core: Simplify HTTPRequest.handle_item_request()



commit fe8cb01fae3f2f14d159ff343fc343f4d9795fd4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Jan 24 00:44:34 2010 +0200

    core: Simplify HTTPRequest.handle_item_request()

 src/rygel/rygel-http-request.vala |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/rygel/rygel-http-request.vala b/src/rygel/rygel-http-request.vala
index 92142a1..4887b7c 100644
--- a/src/rygel/rygel-http-request.vala
+++ b/src/rygel/rygel-http-request.vala
@@ -43,8 +43,6 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
 
     public Cancellable cancellable { get; set; }
 
-    private HTTPResponse response;
-
     private string item_id;
     private int thumbnail_index;
     public MediaItem item;
@@ -135,10 +133,6 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
         yield this.handle_item_request ();
     }
 
-    private void on_response_completed (HTTPResponse response) {
-        this.end (Soup.KnownStatusCode.NONE);
-    }
-
     private async void handle_item_request () {
         try {
             if (HTTPTimeSeek.needed (this)) {
@@ -161,9 +155,11 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
                 return;
             }
 
-            this.response = this.handler.render_body (this);
-            this.response.completed += on_response_completed;
-            yield this.response.run ();
+            var response = this.handler.render_body (this);
+
+            yield response.run ();
+
+            this.end (Soup.KnownStatusCode.NONE);
         } catch (Error error) {
             this.handle_error (error);
         }



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