(maxResponseTime time.Duration)
| 211 | } |
| 212 | |
| 213 | func (cfg *Config) setServerMaxResponseTime(maxResponseTime time.Duration) { |
| 214 | if maxResponseTime < 0 { |
| 215 | maxResponseTime = 0 |
| 216 | } |
| 217 | |
| 218 | // Give an additional minute for the maximum response time, |
| 219 | // so the response body may be sent to the requester. |
| 220 | maxResponseTime += time.Minute |
| 221 | if len(cfg.Server.HTTP.ListenAddr) > 0 && cfg.Server.HTTP.WriteTimeout == 0 { |
| 222 | cfg.Server.HTTP.WriteTimeout = Duration(maxResponseTime) |
| 223 | } |
| 224 | |
| 225 | if len(cfg.Server.HTTPS.ListenAddr) > 0 && cfg.Server.HTTPS.WriteTimeout == 0 { |
| 226 | cfg.Server.HTTPS.WriteTimeout = Duration(maxResponseTime) |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | func (c *Config) groupToNetwork(src NetworksOrGroups) (Networks, error) { |
| 231 | if len(src) == 0 { |
no test coverage detected