Re: [PATCH spice-gtk] file transfer: vdagent need a cancel msg when user cancel a file tranfser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2015-11-18 at 11:29 +0800, Jay.han wrote:
> 
> According to vdagent fileXfer, it requires a
>  VD_AGENT_FILE_XFER_STATUS_CANCELLED msg when user cancel a file transfer.
> Currently our code only send VD_AGENT_FILE_XFER_STATUS_ERROR,
> this will cause the vdagent lock the file until it restart, you can't remove
> the broken file.
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index 8138fd5..7a9af7b 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -1922,7 +1922,8 @@ static void file_xfer_read_cb(GObject *source_object,
>      } else if (error) {
>          VDAgentFileXferStatusMessage msg = {
>              .id = self->priv->id,
> -            .result = VD_AGENT_FILE_XFER_STATUS_ERROR,
> +            .result = error->code == G_IO_ERROR_CANCELLED ? 
> +                    VD_AGENT_FILE_XFER_STATUS_CANCELLED :
> VD_AGENT_FILE_XFER_STATUS_ERROR,
>          };
>          agent_msg_queue_many(self->priv->channel, VD_AGENT_FILE_XFER_STATUS,
>                               &msg, sizeof(msg), NULL);
> -- 
> Jay.Han
> 

Thank you for your patch. It looks correct to me. 

But your description above indicates that there may also be a bug in the
vdagent. The file should not be locked if we send an error message to the
vdagent. Were you using a windows guest or a linux guest?

In the future, could you send patches in plain-text format so we can easily
apply them to the git repository?

Thanks a lot!
Jonathon


_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]