diff --git a/client/red_client.cpp b/client/red_client.cpp index 4923f296..c632a216 100644 --- a/client/red_client.cpp +++ b/client/red_client.cpp @@ -351,7 +351,7 @@ RedClient::RedClient(Application& application) , _mouse_mode (SPICE_MOUSE_MODE_SERVER) , _notify_disconnect (false) , _auto_display_res (false) - , _agent_reply_wait_type (-1) + , _agent_reply_wait_type (VD_AGENT_END_MESSAGE) , _aborting (false) , _agent_connected (false) , _agent_mon_config_sent (false) @@ -1060,7 +1060,7 @@ void RedClient::on_agent_reply(VDAgentReply* reply) if (_agent_reply_wait_type == reply->type) { post_message(new Message(SPICE_MSGC_MAIN_ATTACH_CHANNELS)); _application.deactivate_interval_timer(*_agent_timer); - _agent_reply_wait_type = -1; + _agent_reply_wait_type = VD_AGENT_END_MESSAGE; } break; default: diff --git a/client/red_client.h b/client/red_client.h index ae52d9f2..7b04d083 100644 --- a/client/red_client.h +++ b/client/red_client.h @@ -318,7 +318,7 @@ private: bool _notify_disconnect; bool _auto_display_res; DisplaySetting _display_setting; - int _agent_reply_wait_type; + uint32_t _agent_reply_wait_type; bool _aborting; diff --git a/client/red_peer.cpp b/client/red_peer.cpp index 08176d09..6ff58446 100644 --- a/client/red_peer.cpp +++ b/client/red_peer.cpp @@ -91,7 +91,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) THROW_ERR(SPICEC_ERROR_CODE_GETHOSTBYNAME_FAILED, "cannot resolve host address %s", host); } Lock lock(_lock); - _peer = -1; + _peer = INVALID_SOCKET; for (e = result; e != NULL; e = e->ai_next) { if ((_peer = socket(e->ai_family, e->ai_socktype, e->ai_protocol)) == INVALID_SOCKET) { int err = sock_error(); @@ -112,7 +112,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) LOG_INFO("Connect failed: %s (%d)", sock_err_message(err), err); closesocket(_peer); - _peer = -1; + _peer = INVALID_SOCKET; continue; } LOG_INFO("Connected to %s %s", uaddr, uport); @@ -120,7 +120,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) } lock.unlock(); freeaddrinfo(result); - if (_peer == -1) { + if (_peer == INVALID_SOCKET) { THROW_ERR(SPICEC_ERROR_CODE_CONNECT_FAILED, "failed to connect: %s (%d)", sock_err_message(err), err); }