Skip to content

handoff: the caller's line itself, from app_dmodem and on to a BBS - #15

Merged
Neo-Desktop merged 1 commit into
mainfrom
claude/project-thread-o07i2c
Nov 8, 2026
Merged

Neo-Desktop merged 1 commit into
mainfrom
claude/project-thread-o07i2c

Conversation

@Neo-Desktop

Copy link
Copy Markdown
Collaborator

Requested by Sydney · project thread

Hands the caller's line over by fd passing (SCM_RIGHTS) instead of copying bytes. It is opt-in at both ends, and copying stays as the fallback.

How it works

  • From app_dmodem (handoff = yes, D-Modem #107): the modem's pty terminal arrives with the header. -serve runs the caller's session on that terminal as its controlling tty, so the menu, shells and pppd sit on the modem's line itself and nothing is copied. The connection carries nothing more:
    • When the caller hangs up, the connection closes and the session gets SIGHUP.
    • When the session ends, the connection closes and app_dmodem hangs up.
  • On to a BBS (item handoff = yes, needs mode = unix and header = yes): the session's terminal goes to the server with the header. The item's send and any typed-ahead bytes go right after the header. The menu waits until the server closes the connection, then has the line back (after = menu).
  • Time limits: at the deadline the menu closes the connection, which takes the line back. PPP is still a child of the session, so maxconnect and the SIGHUP backstop at the deadline still apply.

Tests

  • TestServeHandoff: eight callers at once on handed-over lines. Each session runs on a terminal, and each caller is handed on to a BBS that receives the terminal and gives it back, after which the menu shows again. The caller hanging up closes the connection.
  • TestHandoffTimeLimit: PPP on a handed-over line is ended at the time limit, and the call is hung up.
  • TestHandoffSettings: handoff without mode = unix and header = yes is refused.
  • Locally, I also ran the real bbs (D-Modem/bbs, [listen] with handoff = yes) behind the real modemmenu -serve. Two callers at the same time each got a handed-over pty line, were both in the BBS at once, logged off back to the menu, and hung up cleanly.
  • go test -race ./... passes.

Generated by Claude Code

A header that comes with a descriptor (SCM_RIGHTS; app_dmodem's
handoff = yes passes the modem's pty terminal) gives -serve the line
itself: the session runs on that terminal as its controlling tty, so
the menu, shells and pppd are on the modem's line and nothing is
copied.  The connection then only marks the session's life: the
caller gone closes it (SIGHUP to the session), the session ending
closes it (app_dmodem hangs up).

An item with handoff = yes (mode = unix, header = yes) hands the
session's line to its server the same way, the item's send and what
the menu read and did not use right after the header, and has it back
when the server closes the connection (after = menu shows the menu
again).  The time limit still holds: at the deadline the menu closes
the connection.

Tests: eight callers at once on handed-over lines, each session on a
terminal, each handed on to a BBS that takes the terminal and gives it
back; PPP on a handed-over line ended at its time limit, the call hung
up; handoff without mode = unix and header = yes refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRxseyEuLRFbFaBoX3
@Neo-Desktop Neo-Desktop self-assigned this Nov 8, 2026
@Neo-Desktop
Neo-Desktop merged commit 0983e37 into main Nov 8, 2026
5 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.

2 participants