From 26bb10a48673341f82743b5c595c2e9d5e7e79e5 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Tue, 23 Jul 2019 14:29:50 -0400 Subject: [PATCH] GUACAMOLE-422: Add empty handler and trace logging for nop instruction. --- src/libguac/user-handlers.c | 7 +++++++ src/libguac/user-handlers.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/libguac/user-handlers.c b/src/libguac/user-handlers.c index eeed9bcd..f64fd299 100644 --- a/src/libguac/user-handlers.c +++ b/src/libguac/user-handlers.c @@ -51,6 +51,7 @@ __guac_instruction_handler_mapping __guac_instruction_handler_map[] = { {"put", __guac_handle_put}, {"audio", __guac_handle_audio}, {"argv", __guac_handle_argv}, + {"nop", __guac_handle_nop}, {NULL, NULL} }; @@ -588,6 +589,12 @@ int __guac_handle_put(guac_user* user, int argc, char** argv) { return 0; } +int __guac_handle_nop(guac_user* user, int argc, char** argv) { + guac_user_log(user, GUAC_LOG_TRACE, + "Received nop instruction"); + return 0; +} + int __guac_handle_disconnect(guac_user* user, int argc, char** argv) { guac_user_stop(user); return 0; diff --git a/src/libguac/user-handlers.h b/src/libguac/user-handlers.h index 17cfc0db..263c2928 100644 --- a/src/libguac/user-handlers.h +++ b/src/libguac/user-handlers.h @@ -177,6 +177,13 @@ __guac_instruction_handler __guac_handle_size; */ __guac_instruction_handler __guac_handle_disconnect; +/** + * Internal handler for the nop instruction. This handler will be called when + * the nop instruction is received, and will do nothing more than a TRACE level + * log of the instruction. + */ +__guac_instruction_handler __guac_handle_nop; + /** * Internal handler function that is called when the size instruction is * received during the handshake process.