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

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

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpwQF3FNKVTS.pgp
Description: PGP signature

_______________________________________________
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]