[Spice-devel] [PATCH spice-gtk 14/16] channel-main: Check no callbacks are pending on xfer start and end

Christophe Fergeau cfergeau at redhat.com
Tue Apr 9 02:47:19 PDT 2013


On Fri, Mar 29, 2013 at 12:40:26PM +0100, Hans de Goede wrote:
> We should never have pending callbacks when we receive a file-xfer start or
> end (success) message from the agent.

ACK (I'd probably move this right after the addition of task->pending, but
not very important).

Christophe
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/channel-main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 5a05651..7513ead 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1700,6 +1700,11 @@ static void file_xfer_handle_status(SpiceMainChannel *channel,
>  
>      switch (msg->result) {
>      case VD_AGENT_FILE_XFER_STATUS_CAN_SEND_DATA:
> +        if (task->pending) {
> +            error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
> +                           "transfer received CAN_SEND_DATA in pending state");
> +            break;
> +        }
>          file_xfer_continue_read(task);
>          return;
>      case VD_AGENT_FILE_XFER_STATUS_CANCELLED:
> @@ -1711,6 +1716,9 @@ static void file_xfer_handle_status(SpiceMainChannel *channel,
>                              "some errors occurred in the spice agent");
>          break;
>      case VD_AGENT_FILE_XFER_STATUS_SUCCESS:
> +        if (task->pending)
> +            error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
> +                                "transfer received success in pending state");
>          break;
>      default:
>          g_warn_if_reached();
> -- 
> 1.8.1.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130409/9a90aa1c/attachment.pgp>


More information about the Spice-devel mailing list