[Spice-commits] gtk/channel-main.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Fri Aug 29 04:04:49 PDT 2014


 gtk/channel-main.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ca151b5090e261342fae63c1fcc55a0b9e967888
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Aug 28 22:17:31 2014 +0200

    xfer: send data message of size 0 for 0-size file
    
    Make sure we send a xfer data message for 0-size files.
    This avoid leaking file descriptiors in guest agent when
    copying such files.
    
    Reported-by: Cody Chan <int64ago at gmail.com>
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1135099

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 6c1b3be..021fa83 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1635,9 +1635,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;


More information about the Spice-commits mailing list