OmniNet 0.7.6: Fix codemax Bug 9 (wss:// ctor crash)
Bug 9 (CRITICAL regression from 0.7.5):
WebSocket::Connection(url) for wss:// never called
m_socket->connect() before performClientHandshake(), causing
a hard process abort with:
*** bit out of range 0 - FD_SETSIZE on fd_set ***: terminated
TLSContext::createSocket() returns a TLSSocket with
m_fd == INVALID_SOCKET. TLSSocket::recvAll() reaches
FD_SET(INVALID_SOCKET, ...) which writes out of bounds
in glibc's __FD_SET macro.
Fix: Add m_socket->connect(parsed->host, parsed->port) after
the setALPNProtocols call in the wss:// branch of
Connection::Connection(url). Mirrors what createConnectedSocket()
does for the plain ws:// branch.
Commit: df07b4f
Affects: any user of WebSocket::Connection(url) with a wss:// URL.
(Hard process abort — no exception to catch.)
Does NOT affect:
- WebSocket::Connection(unique_ptr<Socket>, ...) — server-side
- WebSocket::Connection(url) with ws:// (plain text)
Upgrade: MANDATORY if you adopted wss:// in 0.7.5. The codemax
workaround (reject wss:// upfront) is no longer needed.
Otherwise optional.
Build verified clean. All existing tests pass (no regressions).