From 90993d5d7536f1eafa4cb0d13b40c0c5cefdaee1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 6 Mar 2011 16:57:13 -0800 Subject: [PATCH] Revert "Reinstated ready instruction" This reverts commit 283c1f5ecbbfa06da5ed1300fc0243c2afcadfeb. --- libguac/include/protocol.h | 13 ------------- libguac/src/client.c | 39 +++++++++++++++----------------------- libguac/src/protocol.c | 4 ---- 3 files changed, 15 insertions(+), 41 deletions(-) diff --git a/libguac/include/protocol.h b/libguac/include/protocol.h index e92c5ee4..6b631ca3 100644 --- a/libguac/include/protocol.h +++ b/libguac/include/protocol.h @@ -141,19 +141,6 @@ void guac_send_name(GUACIO* io, const char* name); */ void guac_send_error(GUACIO* io, const char* error); -/** - * Sends a ready instruction over the given GUACIO connection. The - * ready instruction signals the client that the proxy is ready to - * handle server messages, and thus is ready to handle the client's - * ready message. - * - * Normally, this function should not be called by client plugins, - * as the ready instruction will be handled automatically. - * - * @param io The GUACIO connection to use. - */ -void guac_send_ready(GUACIO* io); - /** * Sends a clipboard instruction over the given GUACIO connection. The * clipboard data given will be automatically escaped for transmission. diff --git a/libguac/src/client.c b/libguac/src/client.c index 76a436c7..ca32c468 100644 --- a/libguac/src/client.c +++ b/libguac/src/client.c @@ -213,11 +213,6 @@ guac_client* guac_get_client(int client_fd) { } guac_free_instruction_data(&instruction); - - /* Send ready message */ - guac_send_ready(io); - guac_flush(io); - return client; } /* end if connect */ @@ -254,9 +249,22 @@ void guac_start_client(guac_client* client) { guac_instruction instruction; int wait_result; - /* Client loop */ + /* VNC Client Loop */ for (;;) { + /* Handle server messages */ + if (client->handle_messages) { + + int retval = client->handle_messages(client); + if (retval) { + GUAC_LOG_ERROR("Error handling server messages"); + return; + } + + guac_flush(io); + + } + wait_result = guac_instructions_waiting(io); if (wait_result > 0) { @@ -267,24 +275,7 @@ void guac_start_client(guac_client* client) { do { - if (strcmp(instruction.opcode, "ready") == 0) { - - /* Handle server messages */ - if (client->handle_messages) { - - int retval = client->handle_messages(client); - if (retval) { - GUAC_LOG_ERROR("Error handling server messages"); - return; - } - - guac_send_ready(io); - guac_flush(io); - - } - - } - else if (strcmp(instruction.opcode, "mouse") == 0) { + if (strcmp(instruction.opcode, "mouse") == 0) { if (client->mouse_handler) if ( client->mouse_handler( diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index 8a79c2c3..e942648b 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -226,10 +226,6 @@ void guac_send_error(GUACIO* io, const char* error) { } -void guac_send_ready(GUACIO* io) { - guac_write_string(io, "ready;"); -} - void guac_send_copy(GUACIO* io, int srcl, int srcx, int srcy, int w, int h, int dstl, int dstx, int dsty) { guac_write_string(io, "copy:"); guac_write_int(io, srcl);