mike-jumper commented on a change in pull request #219: GUACAMOLE-422: Add
timezone to client handshake
URL: https://github.com/apache/guacamole-server/pull/219#discussion_r270509831
##########
File path: src/libguac/guacamole/user.h
##########
@@ -498,6 +505,79 @@ struct guac_user {
};
+/**
+ * Handler for Guacamole protocol opcode specific to the handshake that
+ * happens between client and server at the beginning of the connection. The
+ * handler will be invoked when the matching opcode is received during the
+ * handshake process.
+ *
+ * @param user
+ * The user that initiated the handshake.
+ *
+ * @param parser
+ * The parser allocated for parsing the data provided by the client.
+ *
+ * @param timeout
+ * The timeout, in microseconds, for parsing the value.
+ *
+ * @return
+ * Zero if the handshake instruction is successfully parsed; otherwise
+ * false.
+ */
+typedef int __guac_handshake_handler(guac_user* user, int argc, char** argv);
Review comment:
I recommend moving these internal functions and structures to a non-public
header, perhaps
[`user-handlers.h`](https://github.com/apache/guacamole-server/blob/ffe0b57faa97272ee1287bcea74c5d787e221953/src/libguac/user-handlers.h).
In fact, if that's done, you might be able to leverage the existing
`__guac_instruction_handler_mapping`, `__guac_instruction_handler`, etc.
functions. Their counterparts here seem to essentially be duplicates.
Assuming that's the path forward, perhaps there is a way to separate out the
core of `guac_user_handle_instruction()` such that it's possible to pass in
arbitrary mappings (even said core is kept internal to `user-handlers.h` /
`user-handlers.c`)?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services