You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cloud_tunnel): gate background sends on connected_, not fd_
The tick thread (and other producers like the log flusher and runtime
event callbacks) used `fd_ >= 0` as a proxy for "WS link is up". With
TLS that gate opens far too early: Connect() sets `fd_` right after the
TCP handshake, then runs SSL_connect() and the WebSocket upgrade. If
TickMain woke up in that window it called SendJson -> SSL_write before
SSL_connect() returned, and OpenSSL emitted the WebSocket frame as an
early "Application Data" record sandwiched in front of the client's
ChangeCipherSpec/Finished. Cloudflare answered with a fatal
`unexpected_message` alert and reset the connection, surfacing as
cloud tunnel connect failed: TLS handshake failed
(error:0A0003F2:SSL routines::sslv3 alert unexpected message)
in tenboxd's journal on the affected hosts.
Add `std::atomic<bool> connected_` set to true only after the WS 101
upgrade lands and cleared on Disconnect(). SendJson now refuses to
write before that, and TickMain / FlushLogBuffers / the Push* helpers /
the host.connected status field all gate on the same flag.
Bumps VERSION to 0.7.14.
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments