Fix issues related to android client (#4616)

* WireGuard: Fix tunnel not closed

* Dialer: Apply controllers in lc.Control
This commit is contained in:
Cl-He-O authored and GitHub committed 2025-04-14 11:08:26 -04:00
1 parent 53552d73cc
commit 7a2f42f8d5
3 files changed
+20

No files matched your search

+14
View File
@@ -77,6 +77,20 @@ func New(ctx context.Context, conf *DeviceConfig) (*Handler, error) {
}, nil
}
func (h *Handler) Close() (err error) {
go func() {
h.wgLock.Lock()
defer h.wgLock.Unlock()
if h.net != nil {
_ = h.net.Close()
h.net = nil
}
}()
return nil
}
func (h *Handler) processWireGuard(ctx context.Context, dialer internet.Dialer) (err error) {
h.wgLock.Lock()
defer h.wgLock.Unlock()