[Spice-devel] [PATCH spice-gtk 2/4] channel-main: Send an error to the agent on file-xfer read error

Hans de Goede hdegoede at redhat.com
Sun Mar 3 08:52:03 PST 2013


So that the agent knows the rest of the file won't be coming.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/channel-main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 531b1e8..6a29ce8 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1632,6 +1632,13 @@ static void file_xfer_read_cb(GObject *source_object,
     } else {
         /* Error or EOF, close the file */
         if (error) {
+            VDAgentFileXferStatusMessage msg = {
+                .id = task->id,
+                .result = VD_AGENT_FILE_XFER_STATUS_ERROR,
+            };
+            agent_msg_queue_many(task->channel, VD_AGENT_FILE_XFER_STATUS,
+                                 &msg, sizeof(msg), NULL);
+            spice_channel_wakeup(SPICE_CHANNEL(task->channel), FALSE);
             task->error = error;
         }
         g_input_stream_close_async(G_INPUT_STREAM(task->file_stream),
-- 
1.8.1.2



More information about the Spice-devel mailing list