You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by mike-jumper <gi...@git.apache.org> on 2017/01/24 07:50:44 UTC

[GitHub] incubator-guacamole-server pull request #39: GUACAMOLE-171: Move broadcast s...

GitHub user mike-jumper opened a pull request:

    https://github.com/apache/incubator-guacamole-server/pull/39

    GUACAMOLE-171: Move broadcast socket to public API

    This change refactors the previously-private broadcast socket, bringing it into the public portion of the libguac API. Downstream users can now create `guac_socket` instances with broadcast semantics using the `guac_socket_broadcast()` function.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/incubator-guacamole-server broadcast-socket

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-guacamole-server/pull/39.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #39
    
----
commit 98b92f0900cd579cab24c5640cf55d7b0fc5c5f8
Author: Michael Jumper <mj...@apache.org>
Date:   2016-12-21T07:58:53Z

    GUACAMOLE-171: Separate broadcast socket from client. Ensure socket remains threadsafe even if no users are connected.

commit 7a65a63aa9c7e6721652b5f2b6c449bcf840ccb1
Author: Michael Jumper <mj...@apache.org>
Date:   2016-10-07T20:09:59Z

    GUACAMOLE-171: Do not require knowledge of broadcast socket internals (do not acquire write lock around join/leave handlers).

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-server pull request #39: GUACAMOLE-171: Move broadcast s...

Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-server/pull/39#discussion_r97635653
  
    --- 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 --
    
    Why are these moving around?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-server pull request #39: GUACAMOLE-171: Move broadcast s...

Posted by mike-jumper <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-server pull request #39: GUACAMOLE-171: Move broadcast s...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-guacamole-server/pull/39


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-guacamole-server pull request #39: GUACAMOLE-171: Move broadcast s...

Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:

    https://github.com/apache/incubator-guacamole-server/pull/39#discussion_r97648069
  
    --- 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 --
    
    Ok


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---