Reinstated ready instruction
This commit is contained in:
parent
cd4205caf6
commit
47762889cf
@ -141,6 +141,19 @@ 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.
|
||||
|
@ -213,6 +213,11 @@ 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 */
|
||||
@ -249,22 +254,9 @@ void guac_start_client(guac_client* client) {
|
||||
guac_instruction instruction;
|
||||
int wait_result;
|
||||
|
||||
/* VNC Client Loop */
|
||||
/* 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) {
|
||||
|
||||
@ -275,7 +267,24 @@ void guac_start_client(guac_client* client) {
|
||||
|
||||
do {
|
||||
|
||||
if (strcmp(instruction.opcode, "mouse") == 0) {
|
||||
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 (client->mouse_handler)
|
||||
if (
|
||||
client->mouse_handler(
|
||||
|
@ -226,6 +226,10 @@ 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);
|
||||
|
Loading…
Reference in New Issue
Block a user