jmuehlner commented on code in PR #496:
URL: https://github.com/apache/guacamole-server/pull/496#discussion_r1520205304
##########
src/protocols/rdp/rdp.c:
##########
@@ -525,12 +525,24 @@ static int guac_rdp_handle_connection(guac_client*
client) {
/* Set default pointer */
guac_common_cursor_set_pointer(rdp_client->display->cursor);
+ /*
+ * Downgrade the lock to allow for concurrent read access
+ * Access to read locks need to be made available for other processes to
use
+ * while we await credentials from the user.
+ */
+ pthread_rwlock_unlock(&(rdp_client->lock));
Review Comment:
I like this approach, but I think there's at least one assignment that
should probably still be guarded by the write lock - namely:
https://github.com/apache/guacamole-server/blob/main/src/protocols/rdp/rdp.c#L112
The lock itself is a bit unclear on exactly what it's guarding, and it
_might_ be ok to have this particular assignment unguarded since it's only set
once, so the only stale value that any other thread/process could read would be
`NULL`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]