GUACAMOLE-221: Move away from reserved function names.

This commit is contained in:
Nick Couchman 2020-06-26 15:41:16 -04:00
parent 7759f9b1c0
commit 5c309f5cb1

View File

@ -80,7 +80,7 @@ ssize_t __guac_socket_write_length_double(guac_socket* socket, double d) {
* @return * @return
* Zero on success, non-zero on error. * Zero on success, non-zero on error.
*/ */
static int __guac_socket_write_array(guac_socket* socket, const char** array) { static int guac_socket_write_array(guac_socket* socket, const char** array) {
/* Loop through array, writing provided values to the socket. */ /* Loop through array, writing provided values to the socket. */
for (int i=0; array[i] != NULL; i++) { for (int i=0; array[i] != NULL; i++) {
@ -128,7 +128,7 @@ static int __guac_protocol_send_args(guac_socket* socket, const char** args) {
|| __guac_socket_write_length_string(socket, GUACAMOLE_PROTOCOL_VERSION)) || __guac_socket_write_length_string(socket, GUACAMOLE_PROTOCOL_VERSION))
return -1; return -1;
if (__guac_socket_write_array(socket, args)) if (guac_socket_write_array(socket, args))
return -1; return -1;
return guac_socket_write_string(socket, ";"); return guac_socket_write_string(socket, ";");
@ -333,7 +333,7 @@ static int __guac_protocol_send_connect(guac_socket* socket, const char** args)
if (guac_socket_write_string(socket, "7.connect")) if (guac_socket_write_string(socket, "7.connect"))
return -1; return -1;
if (__guac_socket_write_array(socket, args)) if (guac_socket_write_array(socket, args))
return -1; return -1;
return guac_socket_write_string(socket, ";"); return guac_socket_write_string(socket, ";");
@ -975,44 +975,23 @@ int guac_protocol_send_rect(guac_socket* socket,
} }
/** int guac_protocol_send_required(guac_socket* socket, const char** required) {
* Sends the "required" instruction on the given socket, looping
* through all the items provided in the NULL-terminated array, int ret_val;
* and closing out the instruction. Returns zero on success, or
* non-zero on error. guac_socket_instruction_begin(socket);
*
* @param socket
* The socket on which to write the instruction.
*
* @param required
* The NULL-terminated array of required parameters to send
* to the client.
*
* @return
* Zero if successful, non-zero on error.
*/
static int __guac_protocol_send_required(guac_socket* socket,
const char** required) {
// The socket should be kept alive while waiting for user response. // The socket should be kept alive while waiting for user response.
guac_socket_require_keep_alive(socket); guac_socket_require_keep_alive(socket);
if (guac_socket_write_string(socket, "8.required")) if (guac_socket_write_string(socket, "8.required"))
return -1; return -1;
if (__guac_socket_write_array(socket, required)) if (guac_socket_write_array(socket, required))
return -1; return -1;
return guac_socket_write_string(socket, ";"); ret_val = guac_socket_write_string(socket, ";");
}
int guac_protocol_send_required(guac_socket* socket, const char** required) {
int ret_val;
guac_socket_instruction_begin(socket);
ret_val = __guac_protocol_send_required(socket, required);
guac_socket_instruction_end(socket); guac_socket_instruction_end(socket);
return ret_val; return ret_val;