summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-09-01 11:13:49 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-09-07 12:05:50 -0400
commit8855438ab64d025495007b941ac75f2078274c13 (patch)
treed1b1a0a53ce3786aa0bf34f1c4adfc49f0663fc4
parent83b3e3f20dbd7c87e2d7cace68d99138c09ed6ab (diff)
downloadspice-8855438ab64d025495007b941ac75f2078274c13.tar.gz
spice-8855438ab64d025495007b941ac75f2078274c13.tar.xz
spice-8855438ab64d025495007b941ac75f2078274c13.zip
Process outstanding commands in the ring after changing capability bits
When a new client connects, there may be commands in the ring that it can't understand, so we need to process these before forwarding new commands to the client. By doing this after changing the capability bits we ensure that the new client will never see a command that it doesn't understand (under the assumption that the guest will read and obey the capability bits). Acked-by: Alon Levy <alonl@redhat.com>
-rw-r--r--server/red_worker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 1e301c45..75bc0453 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9478,6 +9478,11 @@ static void on_new_display_channel_client(DisplayChannelClient *dcc)
}
red_channel_client_ack_zero_messages_window(&dcc->common.base);
if (worker->surfaces[0].context.canvas) {
+ int ring_is_empty;
+
+ while (red_process_commands(worker, MAX_PIPE_SIZE, &ring_is_empty)) {
+ }
+
red_current_flush(worker, 0);
push_new_primary_surface(dcc);
red_push_surface_image(dcc, 0);