summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-channel.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-08-20 14:59:11 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2010-08-20 14:59:11 +0100
commit37f830e11d113055154c0be5bf734bc441c39d83 (patch)
tree495f3b0233976156d92d9ce5d7b5999102c8f735 /telepathy-glib/base-channel.c
parentbef2a5a43ac571f2170077cb89a5c5f75b98cbff (diff)
downloadtelepathy-glib-37f830e11d113055154c0be5bf734bc441c39d83.tar.gz
BaseChannel: log the (remote) caller of Close()
A reasonably common answer to the frequently-asked question “why are my calls closing?” is “because someone called Close() on them”. The follow-up is usually “who, and why?”. This patch helps with the former; for the latter, you're on your own. (This was 20393e87 in Gabble, for Call channels.)
Diffstat (limited to 'telepathy-glib/base-channel.c')
-rw-r--r--telepathy-glib/base-channel.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c
index 46f34d243..b8559f6fd 100644
--- a/telepathy-glib/base-channel.c
+++ b/telepathy-glib/base-channel.c
@@ -92,6 +92,8 @@
#include "config.h"
#include "base-channel.h"
+#include <dbus/dbus-glib-lowlevel.h>
+
#include <telepathy-glib/channel-iface.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/exportable-channel.h>
@@ -102,7 +104,7 @@
#define DEBUG_FLAG TP_DEBUG_CHANNEL
-#include "debug.h"
+#include "debug-internal.h"
enum
{
@@ -665,6 +667,14 @@ tp_base_channel_close (TpSvcChannel *iface,
TpBaseChannel *chan = TP_BASE_CHANNEL (iface);
TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (chan);
+ if (DEBUGGING)
+ {
+ gchar *caller = dbus_g_method_get_sender (context);
+
+ DEBUG ("called by %s", caller);
+ g_free (caller);
+ }
+
klass->close (chan);
tp_svc_channel_return_from_close (context);