diff options
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-ft-handler.c | 2 | ||||
-rw-r--r-- | libempathy/empathy-tp-file.c | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index c6babb820..f20e62834 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -350,6 +350,8 @@ ft_transfer_operation_callback (EmpathyTpFile *tp_file, EmpathyFTHandler *handler = user_data; EmpathyFTHandlerPriv *priv = GET_PRIV (handler); + DEBUG ("Transfer operation callback, error %p", error); + if (error != NULL) { priv->is_cancelled = TRUE; diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index 0b12d0223..7b0ace6f7 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -162,6 +162,8 @@ ft_operation_close_clean (EmpathyTpFile *tp_file) { EmpathyTpFilePriv *priv = GET_PRIV (tp_file); + DEBUG ("Splice close clean"); + if (priv->op_callback) priv->op_callback (tp_file, NULL, priv->op_user_data); } @@ -172,6 +174,8 @@ ft_operation_close_with_error (EmpathyTpFile *tp_file, { EmpathyTpFilePriv *priv = GET_PRIV (tp_file); + DEBUG ("Splice close with error %s", error->message); + if (priv->op_callback) priv->op_callback (tp_file, error, priv->op_user_data); } @@ -194,8 +198,6 @@ splice_stream_ready_cb (GObject *source, g_clear_error (&error); return; } - - ft_operation_close_clean (tp_file); } static void @@ -301,6 +303,9 @@ tp_file_state_changed_cb (TpChannel *proxy, priv->in_stream ? "present" : "not present", priv->out_stream ? "present" : "not present"); + priv->state = state; + priv->state_change_reason = reason; + /* If the channel is open AND we have the socket path, we can start the * transfer. The socket path could be NULL if we are not doing the actual * data transfer but are just an observer for the channel. @@ -309,8 +314,8 @@ tp_file_state_changed_cb (TpChannel *proxy, priv->unix_socket_path != NULL) tp_file_start_transfer (EMPATHY_TP_FILE (weak_object)); - priv->state = state; - priv->state_change_reason = reason; + if (state == EMP_FILE_TRANSFER_STATE_COMPLETED) + ft_operation_close_clean (EMPATHY_TP_FILE (weak_object)); g_object_notify (weak_object, "state"); } |