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/conn.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/conn.go')
| -rw-r--r-- | internal/net/conn.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/net/conn.go b/internal/net/conn.go index 6d78d8f..a7c53ec 100644 --- a/internal/net/conn.go +++ b/internal/net/conn.go @@ -92,6 +92,23 @@ func (t *tcpConn) SetEcho(on bool) error { return t.writeTelnetCmd(will, echo) } +// EchoSequence returns the telnet negotiation bytes that switch the client's +// echo state. Queued sessions transmit these through the session writer so a +// stalled client cannot block the caller (see Session.SetEcho); the local +// echo state is applied separately via SetEchoState. +func (t *tcpConn) EchoSequence(on bool) []byte { + if on { + return []byte{iac, wont, echo} + } + return []byte{iac, will, echo} +} + +// SetEchoState records the echo state without writing to the network; used +// when the negotiation bytes are queued instead of written inline. +func (t *tcpConn) SetEchoState(on bool) { + t.echoOff = !on +} + const ( iac = 255 will = 251 |
