You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2019/03/25 04:36:07 UTC

[GitHub] [guacamole-server] mike-jumper commented on a change in pull request #219: GUACAMOLE-422: Add timezone to client handshake

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_r268486408
 
 

 ##########
 File path: src/libguac/user-handshake.c
 ##########
 @@ -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;
 
 Review comment:
   So, the documentation for `user->info.timezone` currently states:
   
   > ... If the client does not provide a specific timezone then this will be NULL. ...
   
   As written, this will not be the case. Assuming not providing a timezone means providing the empty string (`8.timezone,0.;`), then this will actually contain the empty string.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services