From 74940af624eca3a6ec0d9da7d0781dd9f29c654c Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 27 Jul 2017 16:01:47 -0600 Subject: [PATCH] httpserver: Set default idle timeout of 5 minutes (closes #1733) Also clarified a comment in SiteConfig --- caddyhttp/httpserver/server.go | 6 +++--- caddyhttp/httpserver/siteconfig.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/caddyhttp/httpserver/server.go b/caddyhttp/httpserver/server.go index c91212ae..626496d3 100644 --- a/caddyhttp/httpserver/server.go +++ b/caddyhttp/httpserver/server.go @@ -461,9 +461,9 @@ func (s *Server) OnStartupComplete() { } // defaultTimeouts stores the default timeout values to use -// if left unset by user configuration. NOTE: Default timeouts -// are disabled (see issue #1464). -var defaultTimeouts Timeouts +// if left unset by user configuration. NOTE: Most default +// timeouts are disabled (see issues #1464 and #1733). +var defaultTimeouts = Timeouts{IdleTimeout: 5 * time.Minute} // tcpKeepAliveListener sets TCP keep-alive timeouts on accepted // connections. It's used by ListenAndServe and ListenAndServeTLS so diff --git a/caddyhttp/httpserver/siteconfig.go b/caddyhttp/httpserver/siteconfig.go index 9f17122c..2d2dced2 100644 --- a/caddyhttp/httpserver/siteconfig.go +++ b/caddyhttp/httpserver/siteconfig.go @@ -53,7 +53,8 @@ type SiteConfig struct { // websockets, etc. Timeouts Timeouts - // If true all unmatched requests will be served by this site + // If true, any requests not matching other site definitions + // may be served by this site. FallbackSite bool }