From b71c8e58f45b98761cb84e662c6245a43d4d5798 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 6 Jun 2022 02:56:40 +0000 Subject: [PATCH] fix(vpn): do not close wait error channel on consumer side --- internal/dns/run.go | 1 - internal/vpn/run.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/internal/dns/run.go b/internal/dns/run.go index 22795b20..dcf1a1c4 100644 --- a/internal/dns/run.go +++ b/internal/dns/run.go @@ -86,7 +86,6 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) { l.logger.Info("starting") stayHere = false case err := <-waitError: // unexpected error - close(waitError) closeStreams() unboundCancel() diff --git a/internal/vpn/run.go b/internal/vpn/run.go index 42f9c9d5..b27dc2ff 100644 --- a/internal/vpn/run.go +++ b/internal/vpn/run.go @@ -96,8 +96,6 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) { l.logger.Info("starting") stayHere = false case err := <-waitError: // unexpected error - close(waitError) - l.statusManager.Lock() // prevent SetStatus from running in parallel l.cleanup(context.Background(), portForwarding)