Make use of the new context parameter in conntrack Wait

This commit is contained in:
Matt Joiner 2019-03-11 10:43:02 +11:00
parent 376c669445
commit 5829c30146
1 changed files with 5 additions and 0 deletions

View File

@ -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