From: Matt Joiner Date: Fri, 25 Jun 2021 05:00:09 +0000 (+1000) Subject: Add http tracker AllowKeepAlive X-Git-Tag: v1.29.0~3 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ff8557cf7e4369c0ef173fb9ca6b73f8cf076dda;p=btrtrc.git Add http tracker AllowKeepAlive --- 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, }, }, }