[PATCH spice-gtk v2 2/5] vmcstream: finish task immediately when reading 0 bytes

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

 



The current implementation finishes it only after new data
arrives from the channel (or after it is cancelled).

Signed-off-by: Jakub Janků <jjanku@xxxxxxxxxx>
---
 src/vmcstream.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/vmcstream.c b/src/vmcstream.c
index 86c949a..b6f6d1a 100644
--- a/src/vmcstream.c
+++ b/src/vmcstream.c
@@ -209,6 +209,11 @@ spice_vmc_input_stream_read_all_async(GInputStream        *stream,
                       cancellable,
                       callback,
                       user_data);
+    if (count == 0) {
+        g_task_return_int(task, 0);
+        g_object_unref(task);
+        return;
+    }
     self->task = task;
     if (cancellable)
         self->cancel_id =
-- 
2.21.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]