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

Jonathon Jongsma jjongsma at redhat.com
Thu Nov 19 12:37:00 PST 2015


Thanks, I've pushed it to the git repository.


On Thu, 2015-11-19 at 17:47 +0800, Jay.han wrote:
>  According to windows 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.
> 
> ---
>  src/channel-main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index 8138fd5..3c3ce5a 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);
> -- 
> 1.9.1
> 
> On Thu, Nov 19, 2015 at 1:56 AM, Eduardo Lima (Etrunko)
> <etrunko at redhat.com> wrote:
> > Hi,
> > 
> > It seems your message was sent with HTML formatting, I can't apply it to
> > the tree. Can you try re-sending it with git send-email? You can find
> > the configuration settings for gmail in git send-email --help page.
> > 
> > Regards, Eduardo.
> > 
> > On 11/18/2015 01:29 AM, 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
> > > 
> > > 
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> > > 
> > 
> > 
> > --
> > Eduardo de Barros Lima (Etrunko)
> > Software Engineer - RedHat
> > etrunko at redhat.com
> 
> 
> 


More information about the Spice-devel mailing list