[Spice-devel] [PATCH spice 1/4] client: Do not try to send display_config until we've received the agent caps

Hans de Goede hdegoede at redhat.com
Sun Oct 17 02:46:17 PDT 2010


Currenty, we check the agent caps in RedClient::handle_agent_connected
for VD_AGENT_CAP_DISPLAY_CONFIG and if present send display_config, but at
this time we have not received the caps yet, so remove this.

Also the send_agent_display_config call in on_agent_announce_capabilities
lacks a check for _agent_disp_config_sent, and we send the display config
before announcing that we may do so by sending our own caps, which seems
inpolite.
---
 client/red_client.cpp |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/client/red_client.cpp b/client/red_client.cpp
index b9e1421..0fc4815 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -1011,11 +1011,6 @@ void RedClient::handle_agent_connected(RedPeer::InMessage* message)
     if (_auto_display_res && !_agent_mon_config_sent) {
         send_agent_monitors_config();
     }
-
-    if (VD_AGENT_HAS_CAPABILITY(_agent_caps, _agent_caps_size,
-            VD_AGENT_CAP_DISPLAY_CONFIG) && !_agent_disp_config_sent) {
-        send_agent_display_config();
-    }
 }
 
 void RedClient::handle_agent_disconnected(RedPeer::InMessage* message)
@@ -1037,15 +1032,15 @@ void RedClient::on_agent_announce_capabilities(
     }
     memcpy(_agent_caps, caps->caps, sizeof(_agent_caps[0]) * caps_size);
 
+    if (caps->request) {
+        send_agent_announce_capabilities(false);
+    }
     if (VD_AGENT_HAS_CAPABILITY(caps->caps, caps_size,
-            VD_AGENT_CAP_DISPLAY_CONFIG)) {
+            VD_AGENT_CAP_DISPLAY_CONFIG) && !_agent_disp_config_sent) {
         // not sending the color depth through send_agent_monitors_config, since
         // it applies only for attached screens.
         send_agent_display_config();
     }
-    if (caps->request) {
-        send_agent_announce_capabilities(false);
-    }
 }
 
 void RedClient::on_agent_reply(VDAgentReply* reply)
-- 
1.7.3.1



More information about the Spice-devel mailing list