aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-ft-handler.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-02-10 00:32:47 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:46:04 +0800
commit2be3236febcc83ebe96ba29dca49f7c1abce6300 (patch)
tree6b5a0ec4245162c5c53c876c96482ca50a46bd4d /libempathy/empathy-ft-handler.c
parentb16406a06699233fd68cc1cf3a3610eed4d63d6c (diff)
downloadgsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar.gz
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar.bz2
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar.lz
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar.xz
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.tar.zst
gsoc2013-empathy-2be3236febcc83ebe96ba29dca49f7c1abce6300.zip
Add debug spew.
Diffstat (limited to 'libempathy/empathy-ft-handler.c')
-rw-r--r--libempathy/empathy-ft-handler.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index 7c9e24c0b..e4bbf3ddf 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -31,6 +31,9 @@
#include "empathy-marshal.h"
#include "empathy-utils.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_FT
+#include "empathy-debug.h"
+
G_DEFINE_TYPE (EmpathyFTHandler, empathy_ft_handler, G_TYPE_OBJECT)
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyFTHandler)
@@ -337,6 +340,8 @@ ft_handler_create_channel_cb (EmpathyDispatchOperation *operation,
GError *myerr = NULL;
EmpathyFTHandlerPriv *priv = GET_PRIV (req_data->handler);
+ DEBUG ("FT: dispatcher create channel CB");
+
if (error != NULL)
{
/* TODO: error handling */
@@ -359,6 +364,8 @@ ft_handler_push_to_dispatcher (RequestData *req_data)
McAccount *account;
EmpathyFTHandlerPriv *priv = GET_PRIV (req_data->handler);
+ DEBUG ("FT: pushing request to the dispatcher");
+
dispatcher = empathy_dispatcher_dup_singleton ();
account = empathy_contact_get_account (priv->contact);
@@ -464,6 +471,8 @@ hash_job_async_close_stream_cb (GObject *source,
GValue *value;
GHashTable *request;
+ DEBUG ("FT: closing stream after hashing.");
+
/* if we're here we for sure have done reading, check if we stopped due
* to an error.
*/
@@ -492,6 +501,8 @@ hash_job_async_close_stream_cb (GObject *source,
/* set the checksum in the request */
request = req_data->request;
+ DEBUG ("FT: got file hash %s", g_checksum_get_string (hash_data->checksum));
+
/* org.freedesktop.Telepathy.Channel.Type.FileTransfer.ContentHash */
value = tp_g_value_slice_new (G_TYPE_STRING);
g_value_set_string (value, g_checksum_get_string (hash_data->checksum));
@@ -524,6 +535,8 @@ hash_job_async_read_cb (GObject *source,
gssize bytes_read;
GError *error = NULL;
+ DEBUG ("FT: reading a chunk for hashing.");
+
bytes_read = g_input_stream_read_finish (hash_data->stream, res, &error);
if (error != NULL)
{
@@ -591,6 +604,8 @@ ft_handler_read_async_cb (GObject *source,
GValue *value;
RequestData *req_data = user_data;
+ DEBUG ("FT: GFile read async CB.");
+
stream = g_file_read_finish (req_data->gfile, res, &error);
if (error != NULL)
{
@@ -633,6 +648,8 @@ ft_handler_gfile_ready_cb (GObject *source,
GError *error = NULL;
EmpathyFTHandlerPriv *priv = GET_PRIV (req_data->handler);
+ DEBUG ("FT: got GFileInfo.");
+
info = g_file_query_info_finish (req_data->gfile, res, &error);
if (error != NULL)
{
@@ -666,6 +683,8 @@ ft_handler_contact_ready_cb (EmpathyContact *contact,
g_assert (priv->contact != NULL);
g_assert (priv->gfile != NULL);
+ DEBUG ("FT: contact is ready.");
+
g_cancellable_set_error_if_cancelled (priv->cancellable, &myerr);
if (myerr == NULL)