net/http: server idleTimeout documentation issue #20383
Closed
Milestone
Comments
CL https://golang.org/cl/46434 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: