chore: remove unused context/cancel in tailnet Conn (#11399)

Spotted during code read; unused fields
This commit is contained in:
Spike Curtis 2024-01-05 08:15:42 +04:00 committed by GitHub
parent 64638b381d
commit 58873fa7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -282,12 +282,9 @@ func NewConn(options *Options) (conn *Conn, err error) {
Logger(options.Logger.Named("net.packet-filter")),
))
dialContext, dialCancel := context.WithCancel(context.Background())
server := &Conn{
blockEndpoints: options.BlockEndpoints,
derpForceWebSockets: options.DERPForceWebSockets,
dialContext: dialContext,
dialCancel: dialCancel,
closed: make(chan struct{}),
logger: options.Logger,
magicConn: magicConn,
@ -392,8 +389,6 @@ func IPFromUUID(uid uuid.UUID) netip.Addr {
// Conn is an actively listening Wireguard connection.
type Conn struct {
dialContext context.Context
dialCancel context.CancelFunc
mutex sync.Mutex
closed chan struct{}
logger slog.Logger
@ -789,7 +784,6 @@ func (c *Conn) Close() error {
_ = c.netStack.Close()
c.logger.Debug(context.Background(), "closed netstack")
c.dialCancel()
_ = c.wireguardMonitor.Close()
_ = c.dialer.Close()
// Stops internals, e.g. tunDevice, magicConn and dnsManager.