From ff8557cf7e4369c0ef173fb9ca6b73f8cf076dda Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 25 Jun 2021 15:00:09 +1000 Subject: [PATCH] Add http tracker AllowKeepAlive --- tracker/http/client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tracker/http/client.go b/tracker/http/client.go index 30db3691..d0c27a02 100644 --- a/tracker/http/client.go +++ b/tracker/http/client.go @@ -14,8 +14,9 @@ type Client struct { type ProxyFunc func(*http.Request) (*url.URL, error) type NewClientOpts struct { - Proxy ProxyFunc - ServerName string + Proxy ProxyFunc + ServerName string + AllowKeepAlive bool } func NewClient(url_ *url.URL, opts NewClientOpts) Client { @@ -29,7 +30,7 @@ func NewClient(url_ *url.URL, opts NewClientOpts) Client { ServerName: opts.ServerName, }, // This is for S3 trackers that hold connections open. - DisableKeepAlives: true, + DisableKeepAlives: !opts.AllowKeepAlive, }, }, } -- 2.48.1