From 5829c301465469c7991a175c3815390af21b2535 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 11 Mar 2019 10:43:02 +1100 Subject: [PATCH] Make use of the new context parameter in conntrack Wait --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index a247b3c4..ba6599fa 100644 --- a/client.go +++ b/client.go @@ -516,10 +516,15 @@ func (cl *Client) dialFirst(ctx context.Context, addr string) dialResult { left++ go func() { cte := cl.config.ConnTracker.Wait( + ctx, conntrack.Entry{network, s.Addr().String(), addr}, "dial torrent client", 0, ) + if ctx.Err() != nil { + resCh <- dialResult{} + return + } c, err := s.dial(ctx, addr) // This is a bit optimistic, but it looks non-trivial to thread // this through the proxy code. Set it now in case we close the -- 2.48.1