[glib] GDBusWorker: debug on read errors if transport debugging is enabled



commit 214d249f40de028c5f76cea6ed665af5e1cf45d0
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Thu Nov 10 19:06:43 2011 +0000

    GDBusWorker: debug on read errors if transport debugging is enabled
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
    Bug-NB: NB#287088
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Colin Walters <walters verbum org>

 gio/gdbusprivate.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index 38b17f3..3d4b1dc 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -647,6 +647,19 @@ _g_dbus_worker_do_read_cb (GInputStream  *input_stream,
 
   if (bytes_read == -1)
     {
+      if (G_UNLIKELY (_g_dbus_debug_transport ()))
+        {
+          _g_dbus_debug_print_lock ();
+          g_print ("========================================================================\n"
+                   "GDBus-debug:Transport:\n"
+                   "  ---- READ ERROR on stream of type %s:\n"
+                   "  ---- %s %d: %s\n",
+                   g_type_name (G_TYPE_FROM_INSTANCE (g_io_stream_get_input_stream (worker->stream))),
+                   g_quark_to_string (error->domain), error->code,
+                   error->message);
+          _g_dbus_debug_print_unlock ();
+        }
+
       /* Every async read that uses this callback uses worker->cancellable
        * as its GCancellable. worker->cancellable gets cancelled if and only
        * if the GDBusConnection tells us to close (either via



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