server: Don't stop writing agent data to the guest when the client disconnects

write_to_vdi_port() was checking for reds->agent_state.connected to determine
wether it could write queued data. But agent_state.connected reflects if
*both* ends are connected. If the client has disconnected, but the guest agent
is still connected and some data is still pending (like a final clipboard
release from the client), then this data should be written to the guest agent.
This commit is contained in:
Hans de Goede 2011-04-01 10:16:29 +02:00
parent ef6886732e
commit 7cc85f33be

View File

@ -1170,12 +1170,12 @@ static int write_to_vdi_port()
int total = 0;
int n;
if (!reds->agent_state.connected || reds->mig_target) {
if (!vdagent || reds->mig_target) {
return 0;
}
sif = SPICE_CONTAINEROF(vdagent->base.sif, SpiceCharDeviceInterface, base);
while (reds->agent_state.connected) {
while (vdagent) {
if (!(ring_item = ring_get_tail(&state->write_queue))) {
break;
}