mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-12 19:18:11 +00:00
client: don't die if initial agent timeout triggers
When the client connects to a spice VM, if an agent is detected, there will be a few messages exchanged to exchange capabilities, display resolutions, ... This exchange has a timeout in case something goes wrong. However, when it fires, the client dies. This commit changes this and lets the client connects to the guest when the timeout happens. rhbz #673973
This commit is contained in:
parent
fc2f7d14a2
commit
eb6f554094
@ -340,7 +340,9 @@ void AgentTimer::response(AbstractProcessLoop& events_loop)
|
|||||||
{
|
{
|
||||||
Application* app = static_cast<Application*>(events_loop.get_owner());
|
Application* app = static_cast<Application*>(events_loop.get_owner());
|
||||||
app->deactivate_interval_timer(this);
|
app->deactivate_interval_timer(this);
|
||||||
THROW_ERR(SPICEC_ERROR_CODE_AGENT_TIMEOUT, "vdagent timeout");
|
|
||||||
|
LOG_WARN("timeout while waiting for agent response");
|
||||||
|
_client->send_main_attach_channels();
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainChannelLoop: public MessageHandlerImp<RedClient, SPICE_CHANNEL_MAIN> {
|
class MainChannelLoop: public MessageHandlerImp<RedClient, SPICE_CHANNEL_MAIN> {
|
||||||
@ -371,7 +373,7 @@ RedClient::RedClient(Application& application)
|
|||||||
, _agent_out_msg_size (0)
|
, _agent_out_msg_size (0)
|
||||||
, _agent_out_msg_pos (0)
|
, _agent_out_msg_pos (0)
|
||||||
, _agent_tokens (0)
|
, _agent_tokens (0)
|
||||||
, _agent_timer (new AgentTimer())
|
, _agent_timer (new AgentTimer(this))
|
||||||
, _agent_caps_size(0)
|
, _agent_caps_size(0)
|
||||||
, _agent_caps(NULL)
|
, _agent_caps(NULL)
|
||||||
, _migrate (*this)
|
, _migrate (*this)
|
||||||
|
|||||||
@ -114,8 +114,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RedClient;
|
||||||
|
|
||||||
class AgentTimer: public Timer {
|
class AgentTimer: public Timer {
|
||||||
|
public:
|
||||||
virtual void response(AbstractProcessLoop& events_loop);
|
virtual void response(AbstractProcessLoop& events_loop);
|
||||||
|
AgentTimer(RedClient *client) : _client(client) {};
|
||||||
|
private:
|
||||||
|
RedClient *_client;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map< int, RedPeer::ConnectionOptions::Type> PeerConnectionOptMap;
|
typedef std::map< int, RedPeer::ConnectionOptions::Type> PeerConnectionOptMap;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user