Commit graph

10 commits

Author SHA1 Message Date
Cecylia Bocovich
d186fcd401 Remove property "running" from proxy-pair
We don't need it, and already have a function webrtcIsReady that tells
us what we need to know (whether a datachannel was opened before the
timeout period).
2019-10-31 11:59:13 -04:00
Cecylia Bocovich
9b470fbe4b Removed "janky" snowflake state machine
The only place it was used was in window.onpageunload, and we have a
better way of determining if the proxy is active there (through the ui).

I also removed that code from the webextension since the proxy won't
stop running unless you close the browser and after testing it looks
like that code doesn't notify the user anyway.
2019-10-31 11:59:13 -04:00
Cecylia Bocovich
b9138d0c7e Make sure we close peer connections in proxy
Not closing peer connections was causing UDP sockets to remain open
indefinitely (as reported in ticket #31285).
2019-10-16 10:26:51 -04:00
Arlo Breault
1b14810d34 Enforce consistent indentation in js 2019-08-27 18:19:51 -04:00
Cecylia Bocovich
16a1b69823 Added check for active pair in onopen
Because the timeout makes the pair inactive, we should check for this
state in onopen before connecting to the client. Updated tests to set
the proxy pair to active before testing onopen. Also removed a
redundant statement.
2019-08-26 09:15:38 -04:00
Cecylia Bocovich
e77baabdcf Add a timeout to check if datachannel opened
This is similar to the deadlock bug in the proxy-go instances. If the
proxy-pair sends an answer to the broker, it previously assumed that the
datachannel would be opened and the pair reused only once the
datachannel closed. However, sometimes the datachannel never opens due
to ICE errors or a misbehaving/buggy client causing the proxy to
infinitely loop and the proxy-pair to remain active.

This commit reuses the pair.running attribute to indicate whether or not
the datachannel has been opened and sets a timeout to close the
proxy-pair if it has not been opened by that time.
2019-08-08 10:36:28 -04:00
Arlo Breault
fab39ae57c Cleanup lints identified by eslint
Some files were omitted in the .eslintignore, left as an exercise to the
reader.

We probably want to reduce amount of globals overall and use proper es
modules.
2019-07-10 10:58:29 +02:00
Arlo Breault
c12fcbeb85 Null out relay after closing
This was probably meant to be `@relay = null` is the coffeescript.
2019-07-10 10:58:29 +02:00
Arlo Breault
1867a3f121 Lightly massage some of the generated JavaScript 2019-07-10 10:49:53 +02:00
Arlo Breault
31ad9566e6 Compile coffee files and remove them
With,

  ./node_modules/.bin/coffee -b -c Cakefile `find . -path ./node_modules -prune -o -name '*.coffee'`
2019-07-10 10:49:36 +02:00