Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> On Tue, 2016-07-05 at 15:07 +0200, Victor Toso wrote: > This patch changes: > * rename function: file_xfer_queue -> file_xfer_queue_msg_to_agent > As it makes more clear what this helper function does; > * Use buffer provided by spice_file_transfer_task_read_finish() > instead of accessing SpiceFileTransferTask's private structure > > This change is related to split SpiceFileTransferTask from > channel-main. > --- > src/channel-main.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/src/channel-main.c b/src/channel-main.c > index d071f42..f02daee 100644 > --- a/src/channel-main.c > +++ b/src/channel-main.c > @@ -1934,19 +1934,20 @@ static void file_xfer_data_flushed_cb(GObject > *source_object, > spice_file_transfer_task_read_async(self, file_xfer_read_async_cb, NULL); > } > > -static void file_xfer_queue(SpiceFileTransferTask *self, int data_size) > +static void file_xfer_queue_msg_to_agent(SpiceMainChannel *channel, > + guint32 task_id, > + gchar *buffer, > + gint data_size) > { > VDAgentFileXferDataMessage msg; > - SpiceMainChannel *channel; > > - channel = spice_file_transfer_task_get_channel(self); > g_return_if_fail(channel != NULL); > > - msg.id = spice_file_transfer_task_get_id(self); > + msg.id = task_id; > msg.size = data_size; > agent_msg_queue_many(channel, VD_AGENT_FILE_XFER_DATA, > &msg, sizeof(msg), > - self->buffer, data_size, NULL); > + buffer, data_size, NULL); > spice_channel_wakeup(SPICE_CHANNEL(channel), FALSE); > } > > @@ -1972,7 +1973,7 @@ static void file_xfer_read_async_cb(GObject > *source_object, > return; > } > > - file_xfer_queue(xfer_task, count); > + file_xfer_queue_msg_to_agent(channel, > spice_file_transfer_task_get_id(xfer_task), buffer, count); > if (count == 0) { > /* on EOF just wait for VD_AGENT_FILE_XFER_STATUS from agent */ > return; _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel