mike-jumper commented on a change in pull request #217: GUACAMOLE-414: 
Implement TLS Write Locking Callbacks
URL: https://github.com/apache/guacamole-server/pull/217#discussion_r264058424
 
 

 ##########
 File path: src/protocols/vnc/vnc.c
 ##########
 @@ -182,6 +247,11 @@ void* guac_vnc_client_thread(void* data) {
     rfbClientLog = guac_vnc_client_log_info;
     rfbClientErr = guac_vnc_client_log_error;
 
+#ifdef ENABLE_VNC_TLS_LOCKING
+    /* Initialize the write lock */
+    pthread_mutex_init(&(vnc_client->tls_lock), NULL);
 
 Review comment:
   There should be a corresponding `pthread_mutex_destroy()` when the mutex is 
no longer needed. This may be easier to manage if the mutex is initialized when 
the `guac_vnc_client` structure is allocated (to ensure 
`pthread_mutex_destroy()` will never be called on `vnc_client->tls_lock` before 
it's been initialized):
   
   
https://github.com/apache/guacamole-server/blob/5e2ddb890a90e840a419f4878381b0c511cc6f25/src/protocols/vnc/client.c#L47-L52

----------------------------------------------------------------
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

Reply via email to