Stay in handle_messages as long as possible for VNC as well.
This commit is contained in:
parent
4b6aa01517
commit
acf5abe355
@ -52,19 +52,25 @@ int vnc_guac_client_handle_messages(guac_client* client) {
|
|||||||
int wait_result;
|
int wait_result;
|
||||||
rfbClient* rfb_client = ((vnc_guac_client_data*) client->data)->rfb_client;
|
rfbClient* rfb_client = ((vnc_guac_client_data*) client->data)->rfb_client;
|
||||||
|
|
||||||
|
/* Initially wait for messages */
|
||||||
wait_result = WaitForMessage(rfb_client, 1000000);
|
wait_result = WaitForMessage(rfb_client, 1000000);
|
||||||
if (wait_result < 0) {
|
while (wait_result > 0) {
|
||||||
guac_client_log_error(client, "Error waiting for VNC server message\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wait_result > 0) {
|
|
||||||
|
|
||||||
|
/* Handle any message received */
|
||||||
if (!HandleRFBServerMessage(rfb_client)) {
|
if (!HandleRFBServerMessage(rfb_client)) {
|
||||||
guac_client_log_error(client, "Error handling VNC server message\n");
|
guac_client_log_error(client, "Error handling VNC server message\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check for additional messages */
|
||||||
|
wait_result = WaitForMessage(rfb_client, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If an error occurs, log it and fail */
|
||||||
|
if (wait_result < 0) {
|
||||||
|
guac_client_log_error(client, "Error waiting for VNC server message\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user