diff options
| author | historia <[not public]> | 2026-09-16 14:41:15 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-16 14:41:15 -0400 |
| commit | 9192d94dea6be5498ab080f3e2df5667af871d7a (patch) | |
| tree | e7aef3089d5d1e8da686c6b6ca9d4faeacb8b20b /internal/net/wsconn.go | |
| parent | 2f34e75f27e5f99cfc1c5f8eaf6ab4ff2fddb1d9 (diff) | |
| download | thehouseoficarus-9192d94dea6be5498ab080f3e2df5667af871d7a.tar.gz | |
fix: casino room eviction, session close race fix, open-payout recovery evidence
Diffstat (limited to 'internal/net/wsconn.go')
| -rw-r--r-- | internal/net/wsconn.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/net/wsconn.go b/internal/net/wsconn.go index 34663ba..29d1947 100644 --- a/internal/net/wsconn.go +++ b/internal/net/wsconn.go @@ -38,8 +38,18 @@ func (w *wsConn) Close() error { } func (w *wsConn) SetEcho(on bool) error { + return w.conn.WriteMessage(websocket.TextMessage, w.EchoSequence(on)) +} + +// EchoSequence returns the browser echo-control bytes for the websocket +// transport; queued sessions send these through the session writer so a +// stalled browser cannot block the caller (see Session.SetEcho). +func (w *wsConn) EchoSequence(on bool) []byte { if on { - return w.conn.WriteMessage(websocket.TextMessage, []byte("\x1b]10;0\x07")) + return []byte("\x1b]10;0\x07") } - return w.conn.WriteMessage(websocket.TextMessage, []byte("\x1b]10;1\x07")) + return []byte("\x1b]10;1\x07") } + +// SetEchoState is a no-op: the websocket transport keeps no local echo state. +func (w *wsConn) SetEchoState(bool) {} |
