GUAC-744: Send ready instruction after guac_client_init.

This commit is contained in:
Michael Jumper 2014-06-26 15:23:00 -07:00
parent a44539b108
commit 86a59c43b3
3 changed files with 29 additions and 0 deletions

View File

@ -236,7 +236,9 @@ void guacd_handle_connection(guac_socket* socket) {
return; return;
} }
/* Send connection ID */
guacd_log_info("Connection ID is \"%s\"", client->connection_id); guacd_log_info("Connection ID is \"%s\"", client->connection_id);
guac_protocol_send_ready(socket, client->connection_id);
/* Start client threads */ /* Start client threads */
guacd_log_info("Starting client"); guacd_log_info("Starting client");

View File

@ -165,6 +165,18 @@ int guac_protocol_send_nest(guac_socket* socket, int index,
*/ */
int guac_protocol_send_nop(guac_socket* socket); int guac_protocol_send_nop(guac_socket* socket);
/**
* Sends a ready instruction over the given guac_socket connection.
*
* If an error occurs sending the instruction, a non-zero value is
* returned, and guac_error is set appropriately.
*
* @param socket The guac_socket connection to use.
* @param id The connection ID of the connection that is ready.
* @return Zero on success, non-zero on error.
*/
int guac_protocol_send_ready(guac_socket* socket, const char* id);
/** /**
* Sends a set instruction over the given guac_socket connection. * Sends a set instruction over the given guac_socket connection.
* *

View File

@ -1060,6 +1060,21 @@ int guac_protocol_send_push(guac_socket* socket, const guac_layer* layer) {
} }
int guac_protocol_send_ready(guac_socket* socket, const char* id) {
int ret_val;
guac_socket_instruction_begin(socket);
ret_val =
guac_socket_write_string(socket, "5.ready,")
|| __guac_socket_write_length_string(socket, id)
|| guac_socket_write_string(socket, ";");
guac_socket_instruction_end(socket);
return ret_val;
}
int guac_protocol_send_rect(guac_socket* socket, int guac_protocol_send_rect(guac_socket* socket,
const guac_layer* layer, int x, int y, int width, int height) { const guac_layer* layer, int x, int y, int width, int height) {