diff options
author | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-05-04 07:26:15 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-06-01 23:47:37 +0800 |
commit | 7d5485549becfc095556d282f6622ce2b16caef0 (patch) | |
tree | 9eaee7f91a366c483756a2eaf95d6b0bbd8729a5 | |
parent | 584de2350d0299bedcdb140cbb9adeb8a13ea42c (diff) | |
download | gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar.gz gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar.bz2 gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar.lz gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar.xz gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.tar.zst gsoc2013-empathy-7d5485549becfc095556d282f6622ce2b16caef0.zip |
Only close the FT operation after the state change
Close the FT operation only after the "completed" state change has been
emitted, so that we can guarantee there will be no other progress
signals emitted after TRANSFER_DONE.
Also, add some other debug calls.
-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"); } |