[Spice-devel] [PATCH 5/5] client: don't crash when agent is missing WAN support

Alon Levy alevy at redhat.com
Mon Jul 18 08:43:31 PDT 2011


On Mon, Jul 18, 2011 at 05:28:26PM +0200, Christophe Fergeau wrote:
> On Mon, Jul 18, 2011 at 05:51:30PM +0300, Alon Levy wrote:
> > > ---
> > >  client/red_client.cpp |   28 ++++++++++++++++++++--------
> > >  1 files changed, 20 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/client/red_client.cpp b/client/red_client.cpp
> > > index 8918e4f..edcdb02 100644
> > > --- a/client/red_client.cpp
> > > +++ b/client/red_client.cpp
> > > @@ -966,19 +966,20 @@ void RedClient::handle_init(RedPeer::InMessage* message)
> > >          agent_start.num_tokens = ~0;
> > >          _marshallers->msgc_main_agent_start(msg->marshaller(), &agent_start);
> > >          post_message(msg);
> > > -    }
> > > -
> > > -    if (_agent_connected) {
> > 
> > Why do we want to send agent_announce_capabilities if !_agent_connected?
> 
> we don't, the old code was doing
> 
> if (_agent_connected) {
>         agent_start.num_tokens = ~0;
>         _marshallers->msgc_main_agent_start(msg->marshaller(), &agent_start);
>         post_message(msg);
> }
> 
> if (_agent_connected) {
>         send_agent_announce_capabilities(true);
>         if (_auto_display_res) {
>            send_agent_monitors_config();
>         }
> }
> 
> I merged the 2 blocks, unless I missed something there's no change as to
> when the send_announce_capabilities() is called.
> 
> > > @@ -1046,6 +1047,17 @@ void RedClient::on_agent_announce_capabilities(
> > >          // not sending the color depth through send_agent_monitors_config, since
> > >          // it applies only for attached screens.
> > >          send_agent_display_config();
> > > +    } else if (!_auto_display_res) {
> > 
> > Who sets _auto_display_res? does this affect windows guest agents? the comment
> > below says linux but the test above seems to be not linux specific.
> 
> No idea, I added this test to mirror the
>         if (_auto_display_res) {
>            send_agent_monitors_config();
>         }
> in handle_init. This avoids changing behaviour when we decided to send the
> monitors config in handle_init. If the comment is misleading, I can change
> it, for example "Some agents don't support monitors/displays ..."

I didn't care about the comment, but about the behavior. I want to be sure
this doesn't change the behavior for the windows agent.

> 
> Christophe



> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel



More information about the Spice-devel mailing list