Skip to content

feat(telnet): implement telnet protocol support#138

Merged
jonwiggins merged 1 commit intomainfrom
optio/task-7b13917d-06be-4885-9b48-14e13119066e
Mar 28, 2026
Merged

feat(telnet): implement telnet protocol support#138
jonwiggins merged 1 commit intomainfrom
optio/task-7b13917d-06be-4885-9b48-14e13119066e

Conversation

@jonwiggins
Copy link
Copy Markdown
Owner

Summary

  • Implement telnet:// protocol handler (RFC 854) with IAC escaping/stripping, negotiation handling, upload support, and timeout support
  • Wire telnet into scheme dispatch, --version output, CLI args (-t/--telnet-option), and include_headers suppression
  • Symlink *.py test scripts in run-curl-tests.sh for negtelnetserver.py

Test plan

  • Curl test 1326: TELNET to HTTP server (stdin upload) — PASS
  • Curl test 1327: TELNET file upload — PASS
  • Curl test 1452: Basic TELNET negotiation — PASS
  • Curl test 1548: TELNET timeout without upload (exit code 28) — PASS
  • Tests 1-50 regression check — 50/50 PASS
  • Tests 1300-1400 regression check — 82/84 PASS (2 pre-existing C API test failures)
  • cargo fmt, clippy, test — all clean

🤖 Generated with Claude Code

…52, 1548)

Add telnet:// protocol handler implementing RFC 854 with:
- Raw bidirectional TCP pipe for batch-oriented transfers
- IAC escaping on send (0xFF → 0xFF 0xFF)
- IAC stripping on receive (command sequences removed from data)
- Telnet negotiation responses (refuse all options: DO→WONT, WILL→DONT)
- Subnegotiation handling (IAC SB ... IAC SE stripped)
- Upload support via --upload-file / -T
- Timeout support via --max-time / -m (exit code 28)
- -t / --telnet-option CLI flag accepted (parsed but not yet negotiated)

Wiring:
- Add pub mod telnet to protocol/mod.rs
- Add "telnet" arm in easy.rs scheme dispatch
- Add "telnet" to --version Protocols line (critical for test discovery)
- Add telnet:// to include_headers suppression list in transfer.rs
- Add -t short flag mapping and --telnet-option handling in args.rs
- Symlink *.py test scripts in run-curl-tests.sh (for negtelnetserver.py)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonwiggins jonwiggins merged commit a6a168e into main Mar 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant