[Spice-devel] [vdagent-win v1] file-transfer: empty data message can be ignored

Victor Toso lists at victortoso.com
Fri Aug 12 15:47:36 UTC 2016


Hi,

On Wed, Aug 10, 2016 at 04:22:34PM +0200, Victor Toso wrote:
> Based on bug solved for linux guest [0], client might send message
> with 0 bytes. This situation might trigger a warning in the VDAgent as
> it does not expect it; VDAgent will send
> VD_AGENT_FILE_XFER_STATUS_ERROR which triggers an error in the client
> too as it already sent all the data.

This might be bad client actually. I'll take a look at it once more...

> 
> [0] https://bugzilla.redhat.com/show_bug.cgi?id=1135099
> 
> Simple fix is to ignore zero sized messages when we don't find the
> xfer-task.
> 
> Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=97227
> ---
>  vdagent/file_xfer.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/vdagent/file_xfer.cpp b/vdagent/file_xfer.cpp
> index 58d3a31..e64fe89 100644
> --- a/vdagent/file_xfer.cpp
> +++ b/vdagent/file_xfer.cpp
> @@ -119,7 +119,12 @@ bool FileXfer::handle_data(VDAgentFileXferDataMessage* data,
>      status->result = VD_AGENT_FILE_XFER_STATUS_ERROR;
>      iter = _tasks.find(data->id);
>      if (iter == _tasks.end()) {
> -        vd_printf("file id %u not found", data->id);
> +        if (data->size == 0) {
> +            vd_printf("file id %u does not exist anymore. "
> +                      "Ignoring empty data message", data->id);
> +            return false;
> +        }
> +        vd_printf("file id %u not found (size is %llu)", data->id, data->size);
>          goto fin;
>      }
>      task = iter->second;
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list