GitHub user lightpriest opened a pull request:
https://github.com/apache/incubator-guacamole-client/pull/208
GUACAMOLE-431: Fix Tunnel handling of CLOSED state
When the tunnel is closed and another `connect()` call is made, it stops
notifying about state changes (`onstatechanges`) if the connection continues
to fail.
Another issue is that the `Tunnel.onerror()` handler is never called the
second time, since it thinks the tunnel is already closed.
The fix is to set the state to `CONNECTING` when calling `connect()`.
I also moved the `setState()` function to the base Tunnel class and used
that whenever a state needs to change in any tunnel implementation, as this
seemed appropriate.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/strigo/incubator-guacamole-client
GUACAMOLE-431
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-guacamole-client/pull/208.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 #208
----
commit d778ad7035a39710a6316905cd430203daad100a
Author: Or Cohen <[email protected]>
Date: 2017-11-07T09:17:42Z
GUACAMOLE-431: Move setState to base Tunnel class
Move `setState()` to Tunnel class to avoid repetition.
commit 63f603ec9dfe91e33f4de83f27b6a81e1992c13a
Author: Or Cohen <[email protected]>
Date: 2017-11-07T09:47:57Z
GUACAMOLE-431: Fix tunnel stuck in CLOSED state
When the tunnel is closed and another `connect()` call is made, it stops
notifying about state changes (`onstatechanges`) if the connection continues
to fail.
This patch sets the state to `CONNECTING` when calling `connect()`.
----
---