Repository navigation
handoff: the caller's line itself, from app_dmodem and on to a BBS - #15
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
handoff = yes, D-Modem #107): the modem's pty terminal arrives with the header.-serveruns 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:handoff = yes, needsmode = unixandheader = yes): the session's terminal goes to the server with the header. The item'ssendand 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).maxconnectand 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:handoffwithoutmode = unixandheader = yesis refused.bbs(D-Modem/bbs,[listen]withhandoff = yes) behind the realmodemmenu -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