Skip to content

support TCP connections#2

Merged
tridge merged 2 commits intomainfrom
pr-tcp-support
Dec 26, 2024
Merged

support TCP connections#2
tridge merged 2 commits intomainfrom
pr-tcp-support

Conversation

@tridge
Copy link
Copy Markdown
Contributor

@tridge tridge commented Dec 26, 2024

also allow for mixed TCP/UDP

@tridge tridge force-pushed the pr-tcp-support branch 2 times, most recently from 5d3a70d to 64ba0e8 Compare December 26, 2024 04:20
@tridge tridge merged commit de189c3 into main Dec 26, 2024
tridge added a commit that referenced this pull request May 10, 2026
Per-row 'kill' button on the owner /me/ and admin /admin/connections
pages drops one connection at a time:

  POST /me/kill/<conn_index>            (owner kills own session)
  POST /admin/<port2>/kill/<conn_index> (admin kills any session)

conn_index 0 is the user side: dropping it ends the whole session
(no proxy without conn1). conn_index >= 1 is an engineer slot — only
that slot is closed, user + other engineers stay up.

Mechanism: webadmin sets CONN_FLAG_DROP_REQUESTED on the matching
ConnEntry in connections.tdb (read-modify-write that preserves any
forward-compat trailing bytes), then SIGUSR1's the child PID. The
PID is validated against /proc/<pid>/comm == 'supportproxy' before
signalling so we never hit a recycled PID. SIGUSR1 sets a sig_atomic_t
flag in the child; main_loop checks it on the next iteration (select
returns EINTR), tdb_traverses for entries belonging to its port2
with the bit set, closes the matching slot, and tdb_deletes the
record so the heartbeat doesn't republish it.

Tests cover both the routing/auth boundary (request_drop sets the
flag on the right record only; admin route is admin-only; PID with
mismatched comm or dead PID is skipped; forward-compat tail bytes
survive the read-modify-write) and the C++ end-to-end drop path
(real proxy + 1 user + 2 signed engineers; drop engineer #2 keeps
others; drop user ends the whole session).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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