[Spice-devel] [PATCH spice-gtk 4/4] channel-main: Handle the new VD_AGENT_FILE_XFER_STATUS_SUCCESS status msg

Christophe Fergeau cfergeau at redhat.com
Mon Mar 4 08:48:08 PST 2013


On Sun, Mar 03, 2013 at 05:52:05PM +0100, Hans de Goede wrote:
> So that we can pass allong an error from the agent to report an xfer error

along

ACK with this typo fixed.

Christophe

> after the last FILE_XFER_DATA message has been sent.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/channel-main.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 6a29ce8..ec29d9b 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1629,24 +1629,22 @@ static void file_xfer_read_cb(GObject *source_object,
>          file_xfer_queue(task, count);
>          file_xfer_flush_async(channel, task->cancellable,
>                                file_xfer_data_flushed_cb, task);
> -    } else {
> -        /* Error or EOF, close the file */
> -        if (error) {
> -            VDAgentFileXferStatusMessage msg = {
> -                .id = task->id,
> -                .result = VD_AGENT_FILE_XFER_STATUS_ERROR,
> -            };
> -            agent_msg_queue_many(task->channel, VD_AGENT_FILE_XFER_STATUS,
> -                                 &msg, sizeof(msg), NULL);
> -            spice_channel_wakeup(SPICE_CHANNEL(task->channel), FALSE);
> -            task->error = error;
> -        }
> +    } else if (error) {
> +        VDAgentFileXferStatusMessage msg = {
> +            .id = task->id,
> +            .result = VD_AGENT_FILE_XFER_STATUS_ERROR,
> +        };
> +        agent_msg_queue_many(task->channel, VD_AGENT_FILE_XFER_STATUS,
> +                             &msg, sizeof(msg), NULL);
> +        spice_channel_wakeup(SPICE_CHANNEL(task->channel), FALSE);
> +        task->error = error;
>          g_input_stream_close_async(G_INPUT_STREAM(task->file_stream),
>                                     G_PRIORITY_DEFAULT,
>                                     task->cancellable,
>                                     file_xfer_close_cb,
>                                     task);
>      }
> +    /* else EOF, do nothing (wait for VD_AGENT_FILE_XFER_STATUS from agent) */
>  }
>  
>  /* coroutine context */
> @@ -1691,6 +1689,8 @@ static void file_xfer_handle_status(SpiceMainChannel *channel,
>          task->error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
>                                    "some errors occurred in the spice agent");
>          break;
> +    case VD_AGENT_FILE_XFER_STATUS_SUCCESS:
> +        break;     
>      default:
>          g_warn_if_reached();
>          task->error = g_error_new(SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
> -- 
> 1.8.1.2
> 
> _______________________________________________
> 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/20130304/1aef2e97/attachment.pgp>


More information about the Spice-devel mailing list