Repository navigation
Conversation
|
AI review | Needs changes The fix correctly prevents data loss during async relay setup, but leaves the socket paused if setup fails, causing connection hangs.
Reviewed 011bf06. AI can be wrong, a maintainer still decides. Comment |
|
The automated review raised a paused-socket leak on setup errors. The existing production callers already destroy the client socket on rejection:
I kept the existing caller-owned error handling and added two regression cases in 011bf06: both LOCAL and DYNAMIC connections must destroy their client socket when asynchronous link lookup rejects after pausing it. Resuming an unhandled stream on an error path would not help forwarding. Validation after this addition: 29 test files / 155 tests pass; typecheck, manifest validation and formatting pass. The first-payload regression still fails on original source and passes with the fix. |
Overview
A SOCKS5 client can send its first application bytes immediately after CONNECT succeeds. The desktop socket is still flowing while
openRelay()awaits link lookup, so those bytes can be lost before the forwarding handler is attached, leaving HTTP requests pending.Changes Made
initialDataand the ready-message queue preserve byte order.getLink()Promise. It verifies bytes arriving during link lookup, initialData, subsequent bytes, and waiting for relay readiness.Related Issues
Fixes #6
Validation
npm run testpasses (29 files, 153 tests).tsc -p .passes with TypeScript 5.9.3 installed separately; the repo does not currently declare the tsc executable.npm run build,npm run validate, andnpm run format:checkpass.Checklist
CHANGELOG.md(left for the release version; validator rejects Unreleased and requires the newest notes to match the manifest)Suggested release note: Client tunnels keep incoming data while preparing the relay, so the first SOCKS5 request is not lost while link lookup is pending.