diff options
author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-08-11 23:09:34 +0800 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-08-11 23:09:34 +0800 |
commit | 4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf (patch) | |
tree | 37ae008fe31a51c807896ae8ff466e58d3a214fb /libempathy/empathy-tp-file.c | |
parent | 95efa6ca70aa8cf1dc3283706c2254f45cad59c5 (diff) | |
download | gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar.gz gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar.bz2 gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar.lz gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar.xz gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.tar.zst gsoc2013-empathy-4e2b40828d4f8c7fd4cbaf27ff345ce2adb4ffcf.zip |
Ignore socket errors when closing the file-transfer channel
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r-- | libempathy/empathy-tp-file.c | 9 |
1 files changed, 7 insertions, 2 deletions
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)); } |