This was due to the fact that server sends a websocket CLOSE protocol,
to which the library tried to respond to, but since it was done during
the "connect" handshake under the connection lock, this caused a
deadlock.
Resolves#925
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
If the user originally connects with "wss://" but has not configured
any secure related option (Options.Secure/TLSConfig), then when
adding implicit URLs (from the server INFO) the library would add
the "ws://" prefix to the received URL.
When trying to connect to those URLs, the library would not try
to make a TLS handshake and would get an error back that would
result in a "websocket invalid connection".
Resolves#914
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
When compression is used, the full message payload need to be
assembled (in case there are continuation frames) before being
decompressed.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Also added missing subscription's lock when setting some fields
at the end of initialization.
Fixed some flappers and missing defers.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>