GUACAMOLE-422: Add client timezone to handshake.
This commit is contained in:
parent
b90e566e1b
commit
f70aa4939f
@ -88,6 +88,13 @@ struct guac_user_info {
|
||||
* stated resolution of the display size request is recommended.
|
||||
*/
|
||||
int optimal_resolution;
|
||||
|
||||
/**
|
||||
* The timezone of the remote system. If the client does not provide
|
||||
* a specific timezone then this will be NULL. The format of the timezone
|
||||
* is the standard tzdata naming convention.
|
||||
*/
|
||||
const char** timezone;
|
||||
|
||||
};
|
||||
|
||||
|
@ -384,6 +384,31 @@ int guac_user_handle_connection(guac_user* user, int usec_timeout) {
|
||||
/* Store image mimetypes */
|
||||
char** image_mimetypes = guac_copy_mimetypes(parser->argv, parser->argc);
|
||||
user->info.image_mimetypes = (const char**) image_mimetypes;
|
||||
|
||||
/* Get client timezone */
|
||||
if (guac_parser_expect(parser, socket, usec_timeout, "timezone")) {
|
||||
|
||||
/* Log error */
|
||||
guac_user_log_handshake_failure(user);
|
||||
guac_user_log_guac_error(user, GUAC_LOG_DEBUG,
|
||||
"Error reading \"timezone\"");
|
||||
|
||||
guac_parser_free(parser);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* Check number of timezone arguments */
|
||||
if (parser->argc < 1) {
|
||||
guac_user_log(user, GUAC_LOG_ERROR, "Received \"timezone\" instruction "
|
||||
"lacked required arguments.");
|
||||
guac_parser_free(parser);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Store timezone */
|
||||
char** timezone = parser->argv[0];
|
||||
user->info.timezone = (const char**) timezone;
|
||||
|
||||
/* Get args from connect instruction */
|
||||
if (guac_parser_expect(parser, socket, usec_timeout, "connect")) {
|
||||
|
Loading…
Reference in New Issue
Block a user