Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-server/pull/39#discussion_r97639500
--- Diff: src/libguac/client.c ---
@@ -544,12 +273,12 @@ int guac_client_add_user(guac_client* client,
guac_user* user, int argc, char**
int retval = 0;
- pthread_rwlock_wrlock(&(client->__users_lock));
-
/* Call handler, if defined */
if (client->join_handler)
retval = client->join_handler(user, argc, argv);
+ pthread_rwlock_wrlock(&(client->__users_lock));
--- End diff --
So that implementations of the `join_handler` and the `leave_handler` need
not be aware of the internals of `guac_client` (that the `guac_client` will
internally acquire a lock on the user list, preventing use of any broadcast
socket).
Prior to this, writing to a broadcast socket within join/leave lead to
undefined results (most likely a segfault). Now, writing to the broadcast
socket within join/leave sends data to all users except the one joining/leaving.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---