From 9666676766bf21364f4fc4d0d1d336e72f2a91b4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 6 Oct 2026 12:57:23 -0400 Subject: refactor: split casino.go, dedup helpers, remove audit docs --- internal/net/conn.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'internal/net/conn.go') diff --git a/internal/net/conn.go b/internal/net/conn.go index d8c867e..df473f5 100644 --- a/internal/net/conn.go +++ b/internal/net/conn.go @@ -196,7 +196,19 @@ func stripIAC(s string) string { i += end + 4 continue } - i += 3 + if b[i+1] == iac { + // IAC IAC is an escaped data byte, not a command. + out = append(out, iac) + i += 2 + continue + } + // WILL/WONT/DO/DONT carry an option byte; every other IAC command is + // the two-byte form and must not eat the following input byte. + if b[i+1] == will || b[i+1] == wont || b[i+1] == do || b[i+1] == dont { + i += 3 + } else { + i += 2 + } if i > len(b) { i = len(b) } -- cgit v1.2.3