From 4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Wed, 11 Aug 2010 11:09:34 -0400 Subject: Ignore socket errors when closing the file-transfer channel --- libempathy/empathy-tp-file.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index fe010041c..3ad81af62 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -93,6 +93,7 @@ typedef struct { EmpathyTpFileOperationCallback op_callback; gpointer op_user_data; + gboolean is_closing; gboolean is_closed; gboolean dispose_run; @@ -241,15 +242,17 @@ splice_stream_ready_cb (GObject *source, gpointer user_data) { EmpathyTpFile *tp_file; + EmpathyTpFilePriv *priv; GError *error = NULL; tp_file = user_data; + priv = GET_PRIV (tp_file); g_output_stream_splice_finish (G_OUTPUT_STREAM (source), res, &error); DEBUG ("Splice stream ready cb, error %p", error); - if (error != NULL) + if (error != NULL && !priv->is_closing) { ft_operation_close_with_error (tp_file, error); g_clear_error (&error); @@ -591,7 +594,7 @@ file_read_async_cb (GObject *source, in_stream = g_file_read_finish (G_FILE (source), res, &error); - if (error != NULL) + if (error != NULL && !priv->is_closing) { ft_operation_close_with_error (tp_file, error); g_clear_error (&error); @@ -674,6 +677,8 @@ close_channel_internal (EmpathyTpFile *tp_file, DEBUG ("Closing channel, should cancel %s", cancel ? "True" : "False"); + priv->is_closing = TRUE; + tp_cli_channel_call_close (priv->channel, -1, channel_closed_cb, GINT_TO_POINTER (cancel), NULL, G_OBJECT (tp_file)); } -- cgit v1.2.3