From d295621352f7dde326529a5d58bc6c9ed7db39bf Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Mon, 15 Feb 2021 15:36:38 +0300 Subject: [PATCH] Pull request: home: inc http timeouts Merge in DNS/adguard-home from 2671-timeout to master Updates #2671. Updates #2682. Squashed commit of the following: commit 79b1a36a79e3c7c26fc1a4b171feb050690f8c83 Author: Ainar Garipov Date: Mon Feb 15 15:25:26 2021 +0300 all: doc changes commit 84229b782bde433faa4ed8b71dd092965787d30e Author: Ainar Garipov Date: Mon Feb 15 15:12:33 2021 +0300 home: imp names commit b18d7b08473c99ddd37ecfa14be8d48838c2afab Author: Ainar Garipov Date: Mon Feb 15 15:04:27 2021 +0300 home: inc http timeouts --- CHANGELOG.md | 3 +++ internal/home/home.go | 6 +++--- internal/home/web.go | 15 ++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f84a1b6a..bb24fb1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to ### Changed +- Increased HTTP API timeouts ([#2671], [#2682]). - "Permission denied" errors when checking if the machine has a static IP no longer prevent the DHCP server from starting ([#2667]). - The server name sent by clients of TLS APIs is not only checked when @@ -46,8 +47,10 @@ and this project adheres to [#2664]: https://github.com/AdguardTeam/AdGuardHome/issues/2664 [#2666]: https://github.com/AdguardTeam/AdGuardHome/issues/2666 [#2667]: https://github.com/AdguardTeam/AdGuardHome/issues/2667 +[#2671]: https://github.com/AdguardTeam/AdGuardHome/issues/2671 [#2675]: https://github.com/AdguardTeam/AdGuardHome/issues/2675 [#2678]: https://github.com/AdguardTeam/AdGuardHome/issues/2678 +[#2682]: https://github.com/AdguardTeam/AdGuardHome/issues/2682 diff --git a/internal/home/home.go b/internal/home/home.go index 8db077ed..422312a6 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -295,9 +295,9 @@ func run(args options) { BindPort: config.BindPort, BetaBindPort: config.BetaBindPort, - ReadTimeout: ReadTimeout, - ReadHeaderTimeout: ReadHeaderTimeout, - WriteTimeout: WriteTimeout, + ReadTimeout: readTimeout, + ReadHeaderTimeout: readHdrTimeout, + WriteTimeout: writeTimeout, } Context.web = CreateWeb(&webConf) if Context.web == nil { diff --git a/internal/home/web.go b/internal/home/web.go index 9cea9c7d..fff2aa07 100644 --- a/internal/home/web.go +++ b/internal/home/web.go @@ -16,17 +16,14 @@ import ( ) const ( - // ReadTimeout is the maximum duration for reading the entire request, + // readTimeout is the maximum duration for reading the entire request, // including the body. - ReadTimeout = 10 * time.Second - - // ReadHeaderTimeout is the amount of time allowed to read request - // headers. - ReadHeaderTimeout = 10 * time.Second - - // WriteTimeout is the maximum duration before timing out writes of the + readTimeout = 30 * time.Second + // readHdrTimeout is the amount of time allowed to read request headers. + readHdrTimeout = 30 * time.Second + // writeTimeout is the maximum duration before timing out writes of the // response. - WriteTimeout = 10 * time.Second + writeTimeout = 30 * time.Second ) type webConfig struct {