GUACAMOLE-629: Add support for sending "argv" instructions from server to client.

This commit is contained in:
Michael Jumper 2019-07-30 13:06:46 -07:00
parent c26672e281
commit a763d47bc7
2 changed files with 45 additions and 0 deletions

View File

@ -932,6 +932,31 @@ int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer,
/* TEXT INSTRUCTIONS */
/**
* Sends an argv 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 to send the connection parameter
* value.
*
* @param stream
* The stream to use to send the connection parameter value.
*
* @param mimetype
* The mimetype of the connection parameter value being sent.
*
* @param name
* The name of the connection parameter whose current value is being sent.
*
* @return
* Zero on success, non-zero on error.
*/
int guac_protocol_send_argv(guac_socket* socket, guac_stream* stream,
const char* mimetype, const char* name);
/**
* Sends a clipboard instruction over the given guac_socket connection.
*

View File

@ -125,6 +125,26 @@ int guac_protocol_send_args(guac_socket* socket, const char** args) {
}
int guac_protocol_send_argv(guac_socket* socket, guac_stream* stream,
const char* mimetype, const char* name) {
int ret_val;
guac_socket_instruction_begin(socket);
ret_val =
guac_socket_write_string(socket, "4.argv,")
|| __guac_socket_write_length_int(socket, stream->index)
|| guac_socket_write_string(socket, ",")
|| __guac_socket_write_length_string(socket, mimetype)
|| guac_socket_write_string(socket, ",")
|| __guac_socket_write_length_string(socket, name)
|| guac_socket_write_string(socket, ";");
guac_socket_instruction_end(socket);
return ret_val;
}
int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer,
int x, int y, int radius, double startAngle, double endAngle,
int negative) {