Files
Amber/app
greenart7c3 7d44c39b34 Sync OkHttpWebSocket with upstream quartz master
Port the relay-socket fixes from quartz's BasicOkHttpWebSocket into
Amber's fork while keeping the Tor/timeout-aware needsReconnect():

- Answer a relay-initiated CLOSE frame (onClosing -> close(1000))
  so OkHttp completes the handshake and reports onClosed at once
  instead of leaving the socket half-closed until the ping timeout.
- Guarantee a single terminal report per session via an
  AtomicBoolean claimed by onClosed/onFailure/disconnect, so late
  callbacks after disconnect no longer reach the relay client.
- disconnect() claims the session and synthesizes
  onClosed(1000, "client disconnect") synchronously, covering the
  case where OkHttp's cancel() raises no callback at all.
- connect() is idempotent (socket != null || ended -> return) and
  onOpen/onMessage drop stale events after the session ended.
- Mark socket/usingOkHttp @Volatile; they are written and read
  across OkHttp callback threads.

Add the upstream close-handshake regression test (raw RFC 6455
loopback relay, no new dependencies); both tests fail on the
previous implementation.
2026-09-14 09:33:13 -03:00
..
2024-03-01 06:56:32 -03:00
2023-07-26 16:44:33 -03:00
2026-09-09 19:06:54 -03:00