GUACAMOLE-422: Add empty handler and trace logging for nop instruction.

This commit is contained in:
Nick Couchman 2019-07-23 14:29:50 -04:00
parent 1a9d1e8b71
commit 26bb10a486
2 changed files with 14 additions and 0 deletions

View File

@ -51,6 +51,7 @@ __guac_instruction_handler_mapping __guac_instruction_handler_map[] = {
{"put", __guac_handle_put}, {"put", __guac_handle_put},
{"audio", __guac_handle_audio}, {"audio", __guac_handle_audio},
{"argv", __guac_handle_argv}, {"argv", __guac_handle_argv},
{"nop", __guac_handle_nop},
{NULL, NULL} {NULL, NULL}
}; };
@ -588,6 +589,12 @@ int __guac_handle_put(guac_user* user, int argc, char** argv) {
return 0; 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) { int __guac_handle_disconnect(guac_user* user, int argc, char** argv) {
guac_user_stop(user); guac_user_stop(user);
return 0; return 0;

View File

@ -177,6 +177,13 @@ __guac_instruction_handler __guac_handle_size;
*/ */
__guac_instruction_handler __guac_handle_disconnect; __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 * Internal handler function that is called when the size instruction is
* received during the handshake process. * received during the handshake process.