diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ec869f..569d39a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,14 @@ See also the [v0.107.51 GitHub milestone][ms-v0.107.51]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Changed + +- The HTTP server's write timeout has been increased from 1 minute to 5 minutes + to match the one used by AdGuard Home's HTTP client to fetch filtering-list + data ([#7041]). + +[#7041]: https://github.com/AdguardTeam/AdGuardHome/issues/7041 + diff --git a/internal/home/httpclient.go b/internal/home/httpclient.go index ae41d6ac..cfcb1bc6 100644 --- a/internal/home/httpclient.go +++ b/internal/home/httpclient.go @@ -6,7 +6,6 @@ import ( "net" "net/http" "net/url" - "time" ) // httpClient returns a new HTTP client that uses the AdGuard Home's own DNS @@ -23,7 +22,7 @@ func httpClient() (c *http.Client) { return &http.Client{ // TODO(a.garipov): Make configurable. - Timeout: time.Minute * 5, + Timeout: writeTimeout, Transport: &http.Transport{ DialContext: dialContext, Proxy: httpProxy, diff --git a/internal/home/web.go b/internal/home/web.go index da327c70..f1997b05 100644 --- a/internal/home/web.go +++ b/internal/home/web.go @@ -23,6 +23,7 @@ import ( "golang.org/x/net/http2/h2c" ) +// TODO(a.garipov): Make configurable. const ( // readTimeout is the maximum duration for reading the entire request, // including the body. @@ -31,7 +32,7 @@ const ( readHdrTimeout = 60 * time.Second // writeTimeout is the maximum duration before timing out writes of the // response. - writeTimeout = 60 * time.Second + writeTimeout = 5 * time.Minute ) type webConfig struct {