[Spice-devel] [PATCH spice-gtk] xfer: send data message of size 0 for 0-size file
Christophe Fergeau
cfergeau at redhat.com
Fri Aug 29 00:55:39 PDT 2014
Hey,
On Thu, Aug 28, 2014 at 10:19:04PM +0200, Marc-André Lureau wrote:
> Make sure we send a xfer data message for 0-size files.
> This avoid leaking file descriptiors in guest agent when
> copying such files.
Has this been tested or should I give it a try? ACK if this has been
tested. You could add a note that the bug was reported by Cody maybe
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1135099
> ---
> gtk/channel-main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index f33b0fd..46c81c1 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1637,9 +1637,11 @@ static void file_xfer_read_cb(GObject *source_object,
> return;
> }
>
> - if (count > 0) {
> + if (count > 0 || task->file_size == 0) {
> task->read_bytes += count;
> file_xfer_queue(task, count);
> + if (count == 0)
> + return;
> file_xfer_flush_async(channel, task->cancellable,
> file_xfer_data_flushed_cb, task);
> task->pending = TRUE;
> --
> 1.9.3
>
> _______________________________________________
> 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: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140829/978c5df1/attachment.sig>
More information about the Spice-devel
mailing list