Files
gerbil/proxy
Laurence 1643d71905 refactor(proxy): use context cancellation for tunnel tracking
- Replace []net.Conn slice with context + atomic counter in activeTunnel
- Use errgroup.WithContext for pipe() to handle goroutine lifecycle
- Use context.AfterFunc to close connections on cancellation
- Fix race condition by comparing tunnel pointers instead of map lookup
- UpdateLocalSNIs now cancels tunnel context instead of iterating conns

This eliminates O(n) connection removal, prevents goroutine leaks,
and provides cleaner cancellation semantics.
2026-03-13 15:47:52 +00:00
..