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_r275028781
##########
File path: src/libguac/user-handshake.c
##########
@@ -171,6 +171,80 @@ static void guac_free_mimetypes(char** mimetypes) {
}
+/* Guacamole handshake handler functions. */
+
+int __guac_handshake_size_handler(guac_user* user, int argc, char** argv) {
+
+ /* Validate size of instruction. */
+ if (argc < 2) {
+ guac_user_log(user, GUAC_LOG_ERROR, "Received \"size\" "
+ "instruction lacked required arguments.");
+ return 1;
+ }
+
+ /* Parse optimal screen dimensions from size instruction */
+ user->info.optimal_width = atoi(argv[0]);
+ user->info.optimal_height = atoi(argv[1]);
+
+ /* If DPI given, set the user resolution */
+ if (argc >= 3)
+ user->info.optimal_resolution = atoi(argv[2]);
+
+ /* Otherwise, use a safe default for rough backwards compatibility */
+ else
+ user->info.optimal_resolution = 96;
+
+ return 0;
+
+}
+
+int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) {
+
+ /* Store audio mimetypes */
+ user->info.audio_mimetypes = (const char**) guac_copy_mimetypes(argv,
argc);
Review comment:
> I also tried settings those mimetypes arrays to NULL at the beginning of
the `guac_handle_connection()` function, but that didn't seem to help, either.
That should do the trick. What failed when you went that route?
----------------------------------------------------------------
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