Commit graph

16 commits

Author SHA1 Message Date
Cecylia Bocovich
64b66c855f Moved function comments to their definitions
Increase readability of code a bit, the function descriptions were
automatically placed in the constructor when we moved from coffeescript.
2019-10-31 11:59:13 -04:00
Cecylia Bocovich
789285e0df Remove "active" property of proxyPairs
Use their existence in the proxy pair list to indicate they are active.
2019-10-31 11:59:13 -04:00
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
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
8a5941daab Fix to check running status before closing proxy
This fixes a bug reported in #31385. There was an error with the proxy
deadlock fix in #31100 where we close proxies regardless of connection
status.
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
Cecylia Bocovich
6cc944f2b4 Reuse proxypair if sendAnswer fails
Make sure to set proxypair.active to false if createAnswer or
setLocalDescription fails. This should prevent one edge case the results
in an infinite loop described in ticket #31100.
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
d3080e2566 Remove mentions of coffeescript from docs 2019-07-10 10:49:53 +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
Serene Han
c0397bc3e0 Begin coffee snowflake proxy 2016-01-09 19:56:46 -08:00
Arlo Breault
8fbc50bec8 Further updates for this repo 2016-01-05 10:12:53 -08:00
Serene Han
ceac90ec07 begin including flashproxy websocket stuff into the JS proxy 2015-12-30 11:08:31 -08:00
Serene Han
a16a4b43a5 begin JS "snowflake" proxy 2015-12-30 09:54:28 -08:00