[rygel] core: Spit more debug output for HTTP requests



commit 60f36561dcb4268f8f67c314db7626b8af9fab22
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Oct 1 18:15:55 2009 +0300

    core: Spit more debug output for HTTP requests

 src/rygel/rygel-http-request.vala |    6 ++++++
 src/rygel/rygel-http-server.vala  |    9 ++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-http-request.vala b/src/rygel/rygel-http-request.vala
index 52e23bc..c0acf65 100644
--- a/src/rygel/rygel-http-request.vala
+++ b/src/rygel/rygel-http-request.vala
@@ -113,6 +113,10 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
 
             // Add headers
             this.request_handler.add_response_headers (this);
+            debug ("Following HTTP headers appended to response:");
+            this.msg.response_headers.foreach ((name, value) => {
+                    debug ("%s : %s", name, value);
+            });
 
             if (this.msg.method == "HEAD") {
                 // Only headers requested, no need to send contents
@@ -165,6 +169,8 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
         this.item_id = this.query.lookup ("itemid");
         var target = this.query.lookup ("transcode");
         if (target != null) {
+            debug ("Transcoding target: %s", target);
+
             var transcoder = this.http_server.get_transcoder (target);
             this.request_handler = new HTTPTranscodeHandler (transcoder,
                                                              this.cancellable);
diff --git a/src/rygel/rygel-http-server.vala b/src/rygel/rygel-http-server.vala
index 54c8ea6..612795a 100644
--- a/src/rygel/rygel-http-server.vala
+++ b/src/rygel/rygel-http-server.vala
@@ -161,6 +161,10 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
     }
 
     private void on_request_completed (HTTPRequest request) {
+        debug ("HTTP %s request for URI '%s' handled.",
+               request.msg.method,
+               request.msg.get_uri ().to_string (false));
+
         /* Remove the request from our list. */
         this.requests.remove (request);
     }
@@ -170,9 +174,12 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
                                  string                    server_path,
                                  HashTable<string,string>? query,
                                  Soup.ClientContext        soup_client) {
-        debug ("HTTP %s request for URI: %s",
+        debug ("HTTP %s request for URI '%s'. Headers:",
                msg.method,
                msg.get_uri ().to_string (false));
+        msg.request_headers.foreach ((name, value) => {
+                debug ("%s : %s", name, value);
+        });
 
         var request = new HTTPRequest (this, server, msg, query);
 



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