Re: [PATCH] [spice-gtk] DND: fix special case that file size is 0

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

 



Hey,

On Mon, Aug 11, 2014 at 12:58:44PM -0400, Marc-André Lureau wrote:
> 
> 
> ----- Original Message -----
> > On windows guest, after dra gging a zero-size file, the file will be occupied
> > by vdagent. For spice-gtk ignores this case, and stops sending data after
> > sending
> > a start message to agent, see here for more details:
> > http://lists.freedesktop.org/archives/spice-devel/2014-August/017184.html
> > I accept the suggestion of Christophe and fix the bug in spice-gtk.
> > Pay attention to the modification of
> > ​
> > agent_msg_queue_many, I think it's a small trick.
> 
> Isn't this changing the protocol?
> 
> We use to send xfer-start of data size 0 and then xfer-data of data size 0, and now we skip the second part.
> 

Actually, I think this is what causes this windows agent bug, with a
file whose size is 0, we never send a xfer-data message containing 0
bytes while the agent is waiting for that.
Something like this might do the trick... (totally untested)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 7a299a4..6eea260 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1637,7 +1637,7 @@ 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);
         file_xfer_flush_async(channel, task->cancellable,

Christophe

Attachment: pgpQAVjQxFh4d.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]