From 199acda704ad6efe375ad8dcd39eb44f8017a6f7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 Nov 2019 08:20:25 -0800 Subject: [PATCH] fix: really obey the context The internal nat discovery logic doesn't properly propagate the context. --- nat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nat.go b/nat.go index c380300..d38ad52 100644 --- a/nat.go +++ b/nat.go @@ -70,6 +70,9 @@ func DiscoverNATs(ctx context.Context) <-chan NAT { if !ok { natpmp = nil } + case <-ctx.Done(): + // timeout. + return } if ok { select {