net/http: server idleTimeout documentation issue #20383
Labels
Documentation
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.8 darwin/amd64
What operating system and processor architecture are you using (
go env
)?not really relevant but listed below:
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/puvvadip/Documents/work"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4r/1g2c4css78b1yn2q32dmqqm0l05w9h/T/go-build790682604=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
Issue
net/http's server documentation states
However, if no conn ReadDeadline is set because idleTimeout is zero at the bottom of the main loop of net/http.(*conn).serve (the relevant code is below)
Then the next iteration of the loop starts with
Which starts with
Therefore in the case where both idleTimeout and readTimeout are not set, the readHeaderTimeout is used. The documentation for idleTimeout should state, “If both are zero, ReadHeaderTimeout is used.”
The text was updated successfully, but these errors were encountered: