[glib/glib-2-28] GDBusWorker: debug on read errors if transport debugging is enabled



commit 8a7bf8c283065b36286b3742213a2310f6417b24
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 5f9d107..04f657c 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -704,6 +704,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]