[Spice-devel] [PATCH spice-protocol 1/2] vd_agent: Add a new VD_AGENT_CLIENT_DISCONNECTED message

Hans de Goede hdegoede at redhat.com
Wed Mar 6 07:20:25 PST 2013


Client -> agent messages can spawn multiple VDIChunks. When this happens
the agent re-assembles the chunks into a complete VDAgentMessage before
processing it. The server only guarentees coherency at the chunk level,
so it is not possible for a partial chunk to get delivered to the agent.

But it is possible for some chunks of a VDAgentMessage to be delivered to
the agent followed by a client to disconnect without the rest of the
VDAgentMessage being delivered!

This will leave the agent in a wrong state, and the first messages send to it
by the next client to connect will get seen as the rest of the VDAgentMessage
from the previous client.

This patch introduces a new VD_AGENT_CLIENT_DISCONNECTED message which the
server will send from the VDP_SERVER_PORT on client disconnect, on which the
agent can then reset its VDP_CLIENT_PORT state.

Note that no capability is added for this, since capabilities are tracked
between the client and the agent only. The server will simply always send
this message on client disconnect, relying on older agents discarding the
message since it has an unknown type (which both the windows and linux agents
already do).

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 spice/vd_agent.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/spice/vd_agent.h b/spice/vd_agent.h
index a150a6f..1c4ebaf 100644
--- a/spice/vd_agent.h
+++ b/spice/vd_agent.h
@@ -72,6 +72,7 @@ enum {
     VD_AGENT_FILE_XFER_START,
     VD_AGENT_FILE_XFER_STATUS,
     VD_AGENT_FILE_XFER_DATA,
+    VD_AGENT_CLIENT_DISCONNECTED,
     VD_AGENT_END_MESSAGE,
 };
 
-- 
1.8.1.4



More information about the Spice-devel mailing list