From fbf61fe81d9e5dc9c0f14fb65e171bf85f972370 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 21 Oct 2012 23:06:54 -0700 Subject: [PATCH] Add begin instruction, to be sent after connection succeeds. --- libguac/include/protocol.h | 11 +++++++++++ libguac/src/protocol.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/libguac/include/protocol.h b/libguac/include/protocol.h index fc73394d..a525ddab 100644 --- a/libguac/include/protocol.h +++ b/libguac/include/protocol.h @@ -180,6 +180,17 @@ typedef enum guac_line_join_style { */ int guac_protocol_send_args(guac_socket* socket, const char** args); +/** + * Sends a begin 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. + * @return Zero on success, non-zero on error. + */ +int guac_protocol_send_begin(guac_socket* socket); + /** * Sends a connect instruction over the given guac_socket connection. * diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index eba527d7..bda4b920 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -399,6 +399,9 @@ int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer, } +int guac_protocol_send_begin(guac_socket* socket) { + return guac_socket_write_string(socket, "5.begin;"); +} int guac_protocol_send_cfill(guac_socket* socket, guac_composite_mode mode, const guac_layer* layer,