saltyrtc / saltyrtc-client-js

SaltyRTC JavaScript implementation.
MIT License
29 stars 6 forks source link

Fix protocol errors triggered by new clients after task state #115

Closed lgrahl closed 5 years ago

lgrahl commented 5 years ago

With this PR we handle new-initiator and new-responder after a peer handshake properly (somewhat). Resolves #114.

An initiator now simply drops new responders when it has already completed the handshake with another responder.

A responder now closes the connection when a new initiator connects after it has already completed a handshake with a previous initiator.

Note that this deviates from the intention of the specification to allow for more than one connection towards a responder over the same WebSocket connection. But resolving this would be far from trivial.


Also makes use of console logging groups and thereby significantly improves readability. What the heck, we found a use case! :tada: