diff --git a/src/protocols/vnc/client.c b/src/protocols/vnc/client.c index 69c852a6..d3c9ba47 100644 --- a/src/protocols/vnc/client.c +++ b/src/protocols/vnc/client.c @@ -205,10 +205,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) { /*** PARSE ARGUMENTS ***/ if (argc != VNC_ARGS_COUNT) { - guac_protocol_send_error(client->socket, - "Wrong argument count received.", - GUAC_PROTOCOL_STATUS_CLIENT_BAD_REQUEST); - guac_socket_flush(client->socket); + guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Wrong argument count received."); 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 (!rfb_client) { - guac_protocol_send_error(client->socket, - "Error initializing VNC client", - GUAC_PROTOCOL_STATUS_SERVER_ERROR); + guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to connect to VNC server."); guac_socket_flush(client->socket); return 1; } diff --git a/src/protocols/vnc/guac_handlers.c b/src/protocols/vnc/guac_handlers.c index 22cdab8c..846b5b2f 100644 --- a/src/protocols/vnc/guac_handlers.c +++ b/src/protocols/vnc/guac_handlers.c @@ -51,7 +51,7 @@ int vnc_guac_client_handle_messages(guac_client* client) { /* Handle any message received */ 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; } @@ -70,7 +70,7 @@ int vnc_guac_client_handle_messages(guac_client* client) { /* If an error occurs, log it and fail */ 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; }