GUAC-556: Use guac_client_abort() for VNC errors. Use appropriate error codes.
This commit is contained in:
parent
22b2618562
commit
81d7731e8a
@ -205,10 +205,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
/*** PARSE ARGUMENTS ***/
|
/*** PARSE ARGUMENTS ***/
|
||||||
|
|
||||||
if (argc != VNC_ARGS_COUNT) {
|
if (argc != VNC_ARGS_COUNT) {
|
||||||
guac_protocol_send_error(client->socket,
|
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Wrong argument count received.");
|
||||||
"Wrong argument count received.",
|
|
||||||
GUAC_PROTOCOL_STATUS_CLIENT_BAD_REQUEST);
|
|
||||||
guac_socket_flush(client->socket);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,9 +288,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
|
|
||||||
/* If the final connect attempt fails, return error */
|
/* If the final connect attempt fails, return error */
|
||||||
if (!rfb_client) {
|
if (!rfb_client) {
|
||||||
guac_protocol_send_error(client->socket,
|
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to connect to VNC server.");
|
||||||
"Error initializing VNC client",
|
|
||||||
GUAC_PROTOCOL_STATUS_SERVER_ERROR);
|
|
||||||
guac_socket_flush(client->socket);
|
guac_socket_flush(client->socket);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ int vnc_guac_client_handle_messages(guac_client* client) {
|
|||||||
|
|
||||||
/* Handle any message received */
|
/* 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_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Error handling message from VNC server.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ int vnc_guac_client_handle_messages(guac_client* client) {
|
|||||||
|
|
||||||
/* If an error occurs, log it and fail */
|
/* If an error occurs, log it and fail */
|
||||||
if (wait_result < 0) {
|
if (wait_result < 0) {
|
||||||
guac_client_log_error(client, "Error waiting for VNC server message\n");
|
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user