mirror of https://github.com/coder/coder.git
chore: remove unused context/cancel in tailnet Conn (#11399)
Spotted during code read; unused fields
This commit is contained in:
parent
64638b381d
commit
58873fa7e2
|
@ -282,12 +282,9 @@ func NewConn(options *Options) (conn *Conn, err error) {
|
||||||
Logger(options.Logger.Named("net.packet-filter")),
|
Logger(options.Logger.Named("net.packet-filter")),
|
||||||
))
|
))
|
||||||
|
|
||||||
dialContext, dialCancel := context.WithCancel(context.Background())
|
|
||||||
server := &Conn{
|
server := &Conn{
|
||||||
blockEndpoints: options.BlockEndpoints,
|
blockEndpoints: options.BlockEndpoints,
|
||||||
derpForceWebSockets: options.DERPForceWebSockets,
|
derpForceWebSockets: options.DERPForceWebSockets,
|
||||||
dialContext: dialContext,
|
|
||||||
dialCancel: dialCancel,
|
|
||||||
closed: make(chan struct{}),
|
closed: make(chan struct{}),
|
||||||
logger: options.Logger,
|
logger: options.Logger,
|
||||||
magicConn: magicConn,
|
magicConn: magicConn,
|
||||||
|
@ -392,8 +389,6 @@ func IPFromUUID(uid uuid.UUID) netip.Addr {
|
||||||
|
|
||||||
// Conn is an actively listening Wireguard connection.
|
// Conn is an actively listening Wireguard connection.
|
||||||
type Conn struct {
|
type Conn struct {
|
||||||
dialContext context.Context
|
|
||||||
dialCancel context.CancelFunc
|
|
||||||
mutex sync.Mutex
|
mutex sync.Mutex
|
||||||
closed chan struct{}
|
closed chan struct{}
|
||||||
logger slog.Logger
|
logger slog.Logger
|
||||||
|
@ -789,7 +784,6 @@ func (c *Conn) Close() error {
|
||||||
|
|
||||||
_ = c.netStack.Close()
|
_ = c.netStack.Close()
|
||||||
c.logger.Debug(context.Background(), "closed netstack")
|
c.logger.Debug(context.Background(), "closed netstack")
|
||||||
c.dialCancel()
|
|
||||||
_ = c.wireguardMonitor.Close()
|
_ = c.wireguardMonitor.Close()
|
||||||
_ = c.dialer.Close()
|
_ = c.dialer.Close()
|
||||||
// Stops internals, e.g. tunDevice, magicConn and dnsManager.
|
// Stops internals, e.g. tunDevice, magicConn and dnsManager.
|
||||||
|
|
Loading…
Reference in New Issue